Remove dead code from portage.digestcheck().
authorZac Medico <zmedico@gentoo.org>
Tue, 11 Apr 2006 03:20:55 +0000 (03:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 11 Apr 2006 03:20:55 +0000 (03:20 -0000)
svn path=/main/trunk/; revision=3124

pym/portage.py

index f47cac76edaae5e2c128be51f45963655a86133b..a3cb1707939b302f85a330b6523ed3abc38a9e12 100644 (file)
@@ -2187,92 +2187,6 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0):
                print red("!!! ")+"Expected: "+str(e.value[3])
                return 0
        return 1
-       
-       #########################################
-       # Old code that's replaced by the above #
-       #########################################   
-       
-       # archive files
-       basedir=mysettings["DISTDIR"]+"/"
-       digestfn=mysettings["FILESDIR"]+"/digest-"+mysettings["PF"]
-
-       # portage files -- p(ortagefiles)basedir
-       pbasedir=mysettings["O"]+"/"
-       manifestfn=pbasedir+"Manifest"
-
-       if not (os.path.exists(digestfn) and os.path.exists(manifestfn)):
-               if "digest" in features:
-                       print ">>> No package digest/Manifest file found."
-                       print ">>> \"digest\" mode enabled; auto-generating new digest..."
-                       return digestgen(myfiles,mysettings)
-               else:
-                       if not os.path.exists(manifestfn):
-                               if strict:
-                                       print red("!!! No package manifest found:"),manifestfn
-                                       return 0
-                               else:
-                                       print "--- No package manifest found:",manifestfn
-                       if not os.path.exists(digestfn):
-                               print "!!! No package digest file found:",digestfn
-                               print "!!! Type \"ebuild foo.ebuild digest\" to generate it."
-                               return 0
-
-       mydigests=digestParseFile(digestfn)
-       if mydigests is None:
-               print "!!! Failed to parse digest file:",digestfn
-               return 0
-       mymdigests=digestParseFile(manifestfn)
-       if "strict" not in features:
-               # XXX: Remove this when manifests become mainstream.
-               pass
-       elif mymdigests is None:
-                       print "!!! Failed to parse manifest file:",manifestfn
-                       if strict:
-                               return 0
-       else:
-               # Check the portage-related files here.
-               mymfiles=listdir(pbasedir,recursive=1,filesonly=1,ignorecvs=1,EmptyOnError=1)
-               manifest_files = mymdigests.keys()
-               # Files unrelated to the build process are ignored for verification by default
-               for x in ["Manifest", "ChangeLog", "metadata.xml"]:
-                       while x in mymfiles:
-                               mymfiles.remove(x)
-                       while x in manifest_files:
-                               manifest_files.remove(x)
-               for x in range(len(mymfiles)-1,-1,-1):
-                       if mymfiles[x] in manifest_files:
-                               manifest_files.remove(mymfiles[x])
-                       elif len(cvstree.apply_cvsignore_filter([mymfiles[x]]))==0:
-                               # we filter here, rather then above; manifest might have files flagged by the filter.
-                               # if something is returned, then it's flagged as a bad file
-                               # manifest doesn't know about it, so we kill it here.
-                               del mymfiles[x]
-                       else:
-                               print red("!!! Security Violation: A file exists that is not in the manifest.")
-                               print "!!! File:",mymfiles[x]
-                               if strict:
-                                       return 0
-               if manifest_files and strict:
-                       print red("!!! Files listed in the manifest do not exist!")
-                       for x in manifest_files:
-                               print x
-                       return 0
-
-               if not digestCheckFiles(mymfiles, mymdigests, pbasedir, note="files  ", strict=strict):
-                       if strict:
-                               print ">>> Please ensure you have sync'd properly. Please try '"+bold("emerge sync")+"' and"
-                               print ">>> optionally examine the file(s) for corruption. "+bold("A sync will fix most cases.")
-                               print
-                               return 0
-                       else:
-                               print "--- Manifest check failed. 'strict' not enabled; ignoring."
-                               print
-
-       if justmanifest:
-               return 1
-
-       # Just return the status, as it's the last check.
-       return digestCheckFiles(myfiles, mydigests, basedir, note="src_uri", strict=strict)
 
 # parse actionmap to spawn ebuild with the appropriate args
 def spawnebuild(mydo,actionmap,mysettings,debug,alwaysdep=0,logfile=None):