field inside the file instead of mangling the mtime of the cache entry
file. Also, fix FsBased._ensure_access() to properly skip the utime()
call when no mtime is passed in. Theses cache changes are compatible
with current stable portage (2.1.4.x), which uses the _mtime_ field
contained in the file when available.
svn path=/main/trunk/; revision=11984
self.label.lstrip(os.path.sep).rstrip(os.path.sep))
write_keys = set(self._known_keys)
write_keys.add("_eclasses_")
+ write_keys.add("_mtime_")
self._write_keys = sorted(write_keys)
if not self.readonly and not os.path.exists(self.location):
self._ensure_dirs()
myf.write("%s=%s\n" % (k, v))
finally:
myf.close()
- self._ensure_access(fp, mtime=values["_mtime_"])
+ self._ensure_access(fp)
#update written. now we move it.
try:
os.chown(path, -1, self._gid)
os.chmod(path, self._perms)
- if mtime:
+ if mtime != -1:
mtime=long(mtime)
os.utime(path, (mtime, mtime))
except (OSError, IOError):