diff options
Diffstat (limited to 'pym/portage/dbapi')
-rw-r--r-- | pym/portage/dbapi/__init__.py | 10 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 8 |
2 files changed, 14 insertions, 4 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 34dfaa760..044faec4e 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -31,7 +31,8 @@ class dbapi(object): _use_mutable = False _known_keys = frozenset(x for x in auxdbkeys if not x.startswith("UNUSED_0")) - _pkg_str_aux_keys = ("EAPI", "KEYWORDS", "SLOT", "repository") + _pkg_str_aux_keys = ("BUILD_TIME", "EAPI", "BUILD_ID", + "KEYWORDS", "SLOT", "repository") def __init__(self): pass @@ -57,7 +58,12 @@ class dbapi(object): @staticmethod def _cmp_cpv(cpv1, cpv2): - return vercmp(cpv1.version, cpv2.version) + result = vercmp(cpv1.version, cpv2.version) + if (result == 0 and cpv1.build_time is not None and + cpv2.build_time is not None): + result = ((cpv1.build_time > cpv2.build_time) - + (cpv1.build_time < cpv2.build_time)) + return result @staticmethod def _cpv_sort_ascending(cpv_list): diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index cf31c8e9c..277c2f188 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -173,7 +173,8 @@ class vardbapi(dbapi): self.vartree = vartree self._aux_cache_keys = set( ["BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "DESCRIPTION", - "EAPI", "HDEPEND", "HOMEPAGE", "IUSE", "KEYWORDS", + "EAPI", "HDEPEND", "HOMEPAGE", + "BUILD_ID", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND", "repository", "RESTRICT" , "SLOT", "USE", "DEFINED_PHASES", "PROVIDES", "REQUIRES" @@ -425,7 +426,10 @@ class vardbapi(dbapi): continue if len(mysplit) > 1: if ps[0] == mysplit[1]: - returnme.append(_pkg_str(mysplit[0]+"/"+x)) + cpv = "%s/%s" % (mysplit[0], x) + metadata = dict(zip(self._aux_cache_keys, + self.aux_get(cpv, self._aux_cache_keys))) + returnme.append(_pkg_str(cpv, metadata=metadata)) self._cpv_sort_ascending(returnme) if use_cache: self.cpcache[mycp] = [mystat, returnme[:]] |