1 |
commit: 907adbeeb89176c63ad7a04288e080f08f3eb401 |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org> |
3 |
AuthorDate: Tue Jul 31 23:07:31 2012 +0000 |
4 |
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Jul 31 23:07:31 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=907adbee |
7 |
|
8 |
Use nanosecond precision in cache for category directory mtimes |
9 |
and cache for cp_list results when using Python >=3.3. |
10 |
|
11 |
--- |
12 |
pym/portage/dbapi/vartree.py | 10 ++++++++-- |
13 |
1 files changed, 8 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py |
16 |
index 08580e8..5008a97 100644 |
17 |
--- a/pym/portage/dbapi/vartree.py |
18 |
+++ b/pym/portage/dbapi/vartree.py |
19 |
@@ -376,7 +376,10 @@ class vardbapi(dbapi): |
20 |
if mysplit[0] == '*': |
21 |
mysplit[0] = mysplit[0][1:] |
22 |
try: |
23 |
- mystat = os.stat(self.getpath(mysplit[0])).st_mtime |
24 |
+ if sys.hexversion >= 0x3030000: |
25 |
+ mystat = os.stat(self.getpath(mysplit[0])).st_mtime_ns |
26 |
+ else: |
27 |
+ mystat = os.stat(self.getpath(mysplit[0])).st_mtime |
28 |
except OSError: |
29 |
mystat = 0 |
30 |
if use_cache and mycp in self.cpcache: |
31 |
@@ -511,7 +514,10 @@ class vardbapi(dbapi): |
32 |
return list(self._iter_match(mydep, |
33 |
self.cp_list(mydep.cp, use_cache=use_cache))) |
34 |
try: |
35 |
- curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime |
36 |
+ if sys.hexversion >= 0x3030000: |
37 |
+ curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime_ns |
38 |
+ else: |
39 |
+ curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime |
40 |
except (IOError, OSError): |
41 |
curmtime=0 |