summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-22 20:24:06 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-22 20:24:06 +0000
commit8cbc9ceaf541042727f7931fc617746cbf2bc1d5 (patch)
treeba83c8e38198b39e70244ff0504871080f9f6791
parent5928fbb44153884b275c2e1ecd67e7499dcf038f (diff)
downloadportage-8cbc9ceaf541042727f7931fc617746cbf2bc1d5.tar.gz
portage-8cbc9ceaf541042727f7931fc617746cbf2bc1d5.tar.bz2
portage-8cbc9ceaf541042727f7931fc617746cbf2bc1d5.zip
For compatibility with float timestamps in python-2.5, convert st_mtime attributes to long wherever portage expects 1s resolution.
svn path=/main/trunk/; revision=4500
-rwxr-xr-xbin/emerge4
-rw-r--r--pym/cache/flat_list.py3
-rw-r--r--pym/eclass_cache.py2
-rw-r--r--pym/portage.py2
-rw-r--r--pym/portage_update.py2
5 files changed, 7 insertions, 6 deletions
diff --git a/bin/emerge b/bin/emerge
index afd107080..bf980104b 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2479,7 +2479,7 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
continue
inforoot=normpath(root+z)
if os.path.isdir(inforoot):
- infomtime = os.stat(inforoot).st_mtime
+ infomtime = long(os.stat(inforoot).st_mtime)
if inforoot not in prev_mtimes or \
prev_mtimes[inforoot] != infomtime:
regen_infodirs.append(inforoot)
@@ -2526,7 +2526,7 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
icount=icount+1
#update mtime so we can potentially avoid regenerating.
- prev_mtimes[inforoot] = os.stat(inforoot).st_mtime
+ prev_mtimes[inforoot] = long(os.stat(inforoot).st_mtime)
if badcount:
print " "+yellow("*")+" Processed",icount,"info files;",badcount,"errors."
diff --git a/pym/cache/flat_list.py b/pym/cache/flat_list.py
index 0cd3edb0e..65fe5a781 100644
--- a/pym/cache/flat_list.py
+++ b/pym/cache/flat_list.py
@@ -35,7 +35,8 @@ class database(fs_template.FsBased):
raise KeyError(cpv)
raise cache_errors.CacheCorruption(cpv, e)
- try: d["_mtime_"] = os.fstat(myf.fileno()).st_mtime
+ try:
+ d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
except OSError, e:
myf.close()
raise cache_errors.CacheCorruption(cpv, e)
diff --git a/pym/eclass_cache.py b/pym/eclass_cache.py
index 1847cbf76..8d2a2bb81 100644
--- a/pym/eclass_cache.py
+++ b/pym/eclass_cache.py
@@ -44,7 +44,7 @@ class cache:
continue
for y in [y for y in os.listdir(x) if y.endswith(".eclass")]:
try:
- mtime=os.stat(x+"/"+y).st_mtime
+ mtime = long(os.stat(os.path.join(x, y)).st_mtime)
except OSError:
continue
ys=y[:-eclass_len]
diff --git a/pym/portage.py b/pym/portage.py
index 104f1a279..b8f984f5c 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6706,7 +6706,7 @@ def global_updates(mysettings, trees, prev_mtimes):
if len(errors) == 0:
# Update our internal mtime since we
# processed all of our directives.
- timestamps[mykey] = mystat.st_mtime
+ timestamps[mykey] = long(mystat.st_mtime)
else:
for msg in errors:
writemsg("%s\n" % msg, noiselevel=-1)
diff --git a/pym/portage_update.py b/pym/portage_update.py
index 0184f04e3..671e9bc13 100644
--- a/pym/portage_update.py
+++ b/pym/portage_update.py
@@ -80,7 +80,7 @@ def grab_updates(updpath, prev_mtimes=None):
file_path = os.path.join(updpath, myfile)
mystat = os.stat(file_path)
if file_path not in prev_mtimes or \
- prev_mtimes[file_path] != mystat.st_mtime:
+ long(prev_mtimes[file_path]) != long(mystat.st_mtime):
f = open(file_path)
content = f.read()
f.close()