From d3caafb7be8bf00185d13b55046f0362ccbfc62d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 13 Apr 2006 03:50:43 +0000 Subject: Fix manifest/digest generation logic for bug #129737. svn path=/main/trunk/; revision=3136 --- pym/portage.py | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'pym/portage.py') 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): -- cgit v1.2.3-1-g7c22