1 |
X-Gentoo-Bug: 564222 |
2 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=564222 |
3 |
--- |
4 |
pym/portage/dbapi/vartree.py | 6 +++++- |
5 |
1 file changed, 5 insertions(+), 1 deletion(-) |
6 |
|
7 |
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py |
8 |
index 5ba8d9d..bac9837 100644 |
9 |
--- a/pym/portage/dbapi/vartree.py |
10 |
+++ b/pym/portage/dbapi/vartree.py |
11 |
@@ -728,7 +728,11 @@ class vardbapi(dbapi): |
12 |
if pkg_data: |
13 |
cache_mtime, metadata = pkg_data |
14 |
if isinstance(cache_mtime, float): |
15 |
- cache_valid = cache_mtime == mydir_stat.st_mtime |
16 |
+ # Handle truncated mtime in order to avoid cache |
17 |
+ # invalidation for livecd squashfs (bug 564222). |
18 |
+ cache_valid = cache_mtime == mydir_stat.st_mtime or ( |
19 |
+ mydir_stat.st_mtime == mydir_stat[stat.ST_MTIME] |
20 |
+ and long(cache_mtime) == mydir_stat[stat.ST_MTIME]) |
21 |
else: |
22 |
# Cache may contain integer mtime. |
23 |
cache_valid = cache_mtime == mydir_stat[stat.ST_MTIME] |
24 |
-- |
25 |
2.4.9 |