summaryrefslogtreecommitdiffstats
path: root/pym/cache
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-25 21:44:04 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-25 21:44:04 +0000
commit71c816041e5edf96c7e60898cd178976856e55a0 (patch)
tree76030b645204e5087b99ed51739fa5b1763108f0 /pym/cache
parentc749106db3d5cb9c47527ccf980458a256a36e87 (diff)
downloadportage-71c816041e5edf96c7e60898cd178976856e55a0.tar.gz
portage-71c816041e5edf96c7e60898cd178976856e55a0.tar.bz2
portage-71c816041e5edf96c7e60898cd178976856e55a0.zip
For full compatibility with older versions of portage, write the path in the serialized _eclasses_ when possible.
svn path=/main/trunk/; revision=4818
Diffstat (limited to 'pym/cache')
-rw-r--r--pym/cache/template.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/pym/cache/template.py b/pym/cache/template.py
index cce8e30a8..565e7d2ab 100644
--- a/pym/cache/template.py
+++ b/pym/cache/template.py
@@ -164,10 +164,9 @@ def serialize_eclasses(eclass_dict):
return "\t".join(["%s\t%s" % (k, str(v)) \
for k, v in eclass_dict.iteritems()])
"""
- """ This is a variation of the old format that uses a relative path instead
- of the full path of the eclass. It should only force a regen in older
- versions of portage (rather than a traceback)."""
- return "\t".join(["%s\teclass\t%s" % (k, str(v)) \
+ if not eclass_dict:
+ return ""
+ return "\t".join(["%s\t%s\t%s" % (k, v[0], str(v[1])) \
for k, v in eclass_dict.iteritems()])
def reconstruct_eclasses(cpv, eclass_string):
@@ -183,11 +182,11 @@ def reconstruct_eclasses(cpv, eclass_string):
try:
if eclasses[1].isdigit():
for x in xrange(0, len(eclasses), 2):
- d[eclasses[x]] = long(eclasses[x + 1])
+ d[eclasses[x]] = ("", long(eclasses[x + 1]))
else:
# The old format contains paths that will be discarded.
for x in xrange(0, len(eclasses), 3):
- d[eclasses[x]] = long(eclasses[x + 2])
+ d[eclasses[x]] = (eclasses[x + 1], long(eclasses[x + 2]))
except ValueError:
raise cache_errors.CacheCorruption(cpv, "_eclasses_ mtime conversion to long failed")
del eclasses