diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-04-13 03:50:43 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-04-13 03:50:43 +0000 |
commit | d3caafb7be8bf00185d13b55046f0362ccbfc62d (patch) | |
tree | a49cebdbcf42b535ef404e390ea2272b1e6487ff /pym/portage.py | |
parent | 0e7de2a54b4330b352147f61fd1046142562ea83 (diff) | |
download | portage-d3caafb7be8bf00185d13b55046f0362ccbfc62d.tar.gz portage-d3caafb7be8bf00185d13b55046f0362ccbfc62d.tar.bz2 portage-d3caafb7be8bf00185d13b55046f0362ccbfc62d.zip |
Fix manifest/digest generation logic for bug #129737.
svn path=/main/trunk/; revision=3136
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/pym/portage.py b/pym/portage.py index 8c9584ea2..413bd4cd9 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2078,33 +2078,20 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", return 1 def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0): - """generates digest file if missing. Assumes all files are available. If - overwrite=0, the digest will only be created if it doesn't already exist. + """Generates a digest file if missing. Assumes all files are available. DEPRECATED: this now only is a compability wrapper for - portage_manifest.Manifest()""" - - # NOTE: manifestonly is useless with manifest2 and therefore ignored - # NOTE: the old code contains a lot of crap that should really be elsewhere - # (e.g. cvs stuff should be in ebuild(1) and/or repoman) - # TODO: error/exception handling - + portage_manifest.Manifest() + NOTE: manifestonly and overwrite are useless with manifest2 and + are therefore ignored.""" global settings mf = Manifest(mysettings["O"], FetchlistDict(mysettings["O"], mysettings), mysettings["DISTDIR"]) - mf.create(assumeDistfileHashes=True) - for f in myarchives: - # the whole type evaluation is only for the case that myarchives isn't a - # DIST file as create() determines the type on its own - writemsg(">>> Creating Manifest for %s\n" % mysettings["O"]) - try: - writemsg(">>> Adding digests for file %s\n" % f) - mf.updateHashesGuessType(f, checkExisting=False, reuseExisting=not os.path.exists(os.path.join(mysettings["DISTDIR"], f))) - except portage_exception.FileNotFound, e: - writemsg("!!! File %s doesn't exist, can't update Manifest\n" % str(e)) - return 0 - # NOTE: overwrite=0 is only used by emerge --digest, not sure we wanna keep that - if overwrite or not os.path.exists(mf.getFullname()): - mf.write(sign=False) - + writemsg(">>> Creating Manifest for %s\n" % mysettings["O"]) + try: + mf.create(assumeDistfileHashes=True, requiredDistfiles=myarchives) + except portage_exception.FileNotFound, e: + writemsg("!!! File %s doesn't exist, can't update Manifest\n" % str(e)) + return 0 + mf.write(sign=False) return 1 def digestParseFile(myfilename, mysettings=None): |