def _show_package_list(self, lst): '''Emit Package signals for a list of packages pkgs should be a list of (trove, status) tuples. Trove is a dict of {(name, version, flavor), metadata}, as constructed by _convert_package. ''' def is_redirected_package(version): # The format of a revision string is # "<upstream version>-<source count>-<build count>". # If upstream version is 0, the package has become nil. return version.split("-")[0] == "0" for pkg, status in lst: name, v, f = pkg["trove"] version = str(v.trailingRevision()) if is_redirected_package(version): continue label = str(v.trailingLabel()) arch = conarypk.get_arch(f) pkg_id = get_package_id(name, version, arch, label) summary = self._format_package_summary( name, pkg["metadata"].get("shortDesc", "").decode("UTF")) self.package(pkg_id, status, summary)
def _show_package_list(self, lst): '''Emit Package signals for a list of packages pkgs should be a list of (trove, status) tuples. Trove is a dict of {(name, version, flavor), metadata}, as constructed by _convert_package. ''' def is_redirected_package(version): # The format of a revision string is # "<upstream version>-<source count>-<build count>". # If upstream version is 0, the package has become nil. return version.split("-")[0] == "0" for pkg, status in lst: name, v, f = pkg["trove"] version = str(v.trailingRevision()) if is_redirected_package(version): continue label = str(v.trailingLabel()) arch = conarypk.get_arch(f) pkg_id = get_package_id(name, version, arch, label) summary = self._format_package_summary(name, pkg["metadata"].get("shortDesc", "").decode("UTF")) self.package(pkg_id, status, summary)
def _pkg_get_unique(self, pkg): ''' Return a unique string for the package ''' name,version,flavor = pkg.get("trove") ver = version.trailingRevision() fl = get_arch(flavor) return "%s-%s.%s" % (name,ver,fl)
def _get_package_id(name, v, f): version = str(v.trailingRevision()) label = str(v.trailingLabel()) arch = conarypk.get_arch(f) package_id = get_package_id(name, version, arch, label) return package_id