Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 322940 Details for
Bug 433964
[PATCH] AgeSet and DateSet should use BUILD_TIME instead of COUNTER filestamp
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Make AgeSet and DateSet use BUILD_TIME key instead of COUNTER mtime
build_time.patch (text/plain), 1.91 KB, created by
Martin Väth
on 2012-09-04 20:15:06 UTC
(
hide
)
Description:
Make AgeSet and DateSet use BUILD_TIME key instead of COUNTER mtime
Filename:
MIME Type:
Creator:
Martin Väth
Created:
2012-09-04 20:15:06 UTC
Size:
1.91 KB
patch
obsolete
>Use BUILD_TIME instead of filestamp of COUNTER for AgeSet and DateSet >--- pym/portage/_sets/dbapi.py >+++ pym/portage/_sets/dbapi.py >@@ -326,6 +326,7 @@ > > class AgeSet(EverythingSet): > _operations = ["merge", "unmerge"] >+ _aux_keys = ('BUILD_TIME',) > > def __init__(self, vardb, mode="older", age=7): > super(AgeSet, self).__init__(vardb) >@@ -335,8 +336,11 @@ > def _filter(self, atom): > > cpv = self._db.match(atom)[0] >- path = self._db.getpath(cpv, filename="COUNTER") >- age = (time.time() - os.stat(path).st_mtime) / (3600 * 24) >+ try: >+ date, = self._db.aux_get(cpv, self._aux_keys) >+ except KeyError: >+ return bool(self._mode == "older") >+ age = (time.time() - float(date)) / (3600 * 24) > if ((self._mode == "older" and age <= self._age) \ > or (self._mode == "newer" and age >= self._age)): > return False >@@ -357,6 +361,7 @@ > > class DateSet(EverythingSet): > _operations = ["merge", "unmerge"] >+ _aux_keys = ('BUILD_TIME',) > > def __init__(self, vardb, date, mode="older"): > super(DateSet, self).__init__(vardb) >@@ -366,8 +371,10 @@ > def _filter(self, atom): > > cpv = self._db.match(atom)[0] >- path = self._db.getpath(cpv, filename="COUNTER") >- date = os.stat(path).st_mtime >+ try: >+ date, = self._db.aux_get(cpv, self._aux_keys) >+ except KeyError: >+ return bool(self._mode == "older") > # Make sure inequality is _strict_ to exclude tested package > if ((self._mode == "older" and date < self._date) \ > or (self._mode == "newer" and date > self._date)): >@@ -402,9 +409,8 @@ > package = options.get("package") > try: > cpv = vardbapi.match(package)[0] >- path = vardbapi.getpath(cpv, filename="COUNTER") >- date = os.stat(path).st_mtime >- except ValueError: >+ date, = vardbapi.aux_get(cpv, ('BUILD_TIME',)) >+ except KeyError: > raise SetConfigError(_("cannot determine installation date of package %s") % package) > elif (format == "filestamp"): > filestamp = options.get("filestamp")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 433964
:
322940
|
323012