Pass DISTDIR into the Manifest constructor instead of getting it from mysettings...
authorZac Medico <zmedico@gentoo.org>
Mon, 10 Apr 2006 01:42:02 +0000 (01:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 10 Apr 2006 01:42:02 +0000 (01:42 -0000)
svn path=/main/trunk/; revision=3110

bin/repoman
pym/portage.py
pym/portage_manifest.py

index 4a46196a5d90b6469ce925bd238368f38da393ad..ac51660273c1dbfe60fc70672addd54d49d29a5e 100755 (executable)
@@ -795,7 +795,8 @@ for x in scanlist:
                                fails["CVS/Entries.IO_error"].append(checkdir+"/files/CVS/Entries")
                        continue
 
-       mf=Manifest(checkdir, db=portage.db["/"]["porttree"].dbapi, mysettings=repoman_settings)
+       mf = Manifest(checkdir, db=portage.db["/"]["porttree"].dbapi,
+               mysettings=repoman_settings, repoman_settings["DISTDIR"])
        mydigests=mf.getTypeDigests("DIST")
        myfiles_all = []
 
index 66cbb6678443817473a5f262d2d45e4b8b00f3ea..727b99ae5d6710fef8d009f1d46ef09fed10cb88 100644 (file)
@@ -2072,7 +2072,8 @@ def digestgen(myarchives,mysettings,db=None,overwrite=1,manifestonly=0):
        if db is None:
                db = portagetree().dbapi
 
-       mf = Manifest(mysettings["O"], db, mysettings)
+       global settings
+       mf = Manifest(mysettings["O"], db, 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 
@@ -2110,7 +2111,7 @@ def digestParseFile(myfilename,mysettings=None,db=None):
        if mysettings is None:
                mysettings = config(clone=settings)
 
-       mf = Manifest(pkgdir, db, mysettings)
+       mf = Manifest(pkgdir, db, mysettings, mysettings["DISTDIR"])
 
        return mf.getDigests()
 
@@ -2164,7 +2165,7 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0, db=None):
        pkgdir = mysettings["O"]
        if db is None:
                db = portagetree().dbapi
-       mf = Manifest(pkgdir, db, mysettings)
+       mf = Manifest(pkgdir, db, mysettings, mysettings["DISTDIR"])
        try:
                if strict:
                        print ">>> checking ebuild checksums",
@@ -2712,6 +2713,28 @@ def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,clea
        if need_distfiles and not fetch(fetchme, mysettings, listonly=listonly, fetchonly=fetchonly):
                return 1
 
+       if mydo=="fetch" and listonly:
+               return 0
+
+       if "digest" in features:
+               #generate digest if it doesn't exist.
+               if mydo=="digest":
+                       return (not digestgen(aalist,mysettings,overwrite=1))
+               else:
+                       digestgen(aalist,mysettings,overwrite=0)
+       elif mydo=="digest":
+               #since we are calling "digest" directly, recreate the digest even if it already exists
+               return (not digestgen(aalist,mysettings,overwrite=1))
+       if mydo=="manifest":
+               return (not digestgen(aalist,mysettings,overwrite=1,manifestonly=1))
+
+       # See above comment about fetching only when needed
+       if not digestcheck(checkme, mysettings, ("strict" in features), (mydo not in ["digest","fetch","unpack"] and settings["PORTAGE_CALLER"] == "ebuild" and "noauto" in features)):
+               return 1
+
+       if mydo=="fetch":
+               return 0
+
        # inefficient.  improve this logic via making actionmap easily searchable to see if we're in the chain of what
        # will be executed, either that or forced N doebuild calls instead of a single set of phase calls.
        if (mydo not in ("setup", "clean", "postinst", "preinst", "prerm", "fetch", "digest", "manifest") and 
@@ -2737,28 +2760,6 @@ def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,clea
                        print "!!! Failed symlinking in '%s' to ebuild distdir" % file
                        raise
 
-       if mydo=="fetch" and listonly:
-               return 0
-
-       if "digest" in features:
-               #generate digest if it doesn't exist.
-               if mydo=="digest":
-                       return (not digestgen(aalist,mysettings,overwrite=1))
-               else:
-                       digestgen(aalist,mysettings,overwrite=0)
-       elif mydo=="digest":
-               #since we are calling "digest" directly, recreate the digest even if it already exists
-               return (not digestgen(aalist,mysettings,overwrite=1))
-       if mydo=="manifest":
-               return (not digestgen(aalist,mysettings,overwrite=1,manifestonly=1))
-
-       # See above comment about fetching only when needed
-       if not digestcheck(checkme, mysettings, ("strict" in features), (mydo not in ["digest","fetch","unpack"] and settings["PORTAGE_CALLER"] == "ebuild" and "noauto" in features)):
-               return 1
-
-       if mydo=="fetch":
-               return 0
-
        #initial dep checks complete; time to process main commands
 
        nosandbox=(("userpriv" in features) and ("usersandbox" not in features) and \
index b50d389edeb09bdca8e14f8ece00843b09d59692..fff9983aabeedd5951ecf787421e046df2561344 100644 (file)
@@ -26,7 +26,7 @@ def manifest2MiscfileFilter(filename):
        return not (filename in ["CVS", ".svn", "files", "Manifest"] or filename.endswith(".ebuild"))
 
 class Manifest(object):
-       def __init__(self, pkgdir, db, mysettings, manifest1_compat=True, from_scratch=False):
+       def __init__(self, pkgdir, db, mysettings, distdir, manifest1_compat=True, from_scratch=False):
                """ create new Manifest instance for package in pkgdir, using db and mysettings for metadata lookups,
                    and add compability entries for old portage versions if manifest1_compat == True.
                    Do not parse Manifest file if from_scratch == True (only for internal use) """
@@ -44,10 +44,7 @@ class Manifest(object):
                self.compat = manifest1_compat
                self.db = db
                self.mysettings = mysettings
-               if mysettings.has_key("PORTAGE_ACTUAL_DISTDIR"):
-                       self.distdir = mysettings["PORTAGE_ACTUAL_DISTDIR"]
-               else:
-                       self.distdir = mysettings["DISTDIR"]
+               self.distdir = distdir
                
        def guessType(self, filename):
                """ Perform a best effort guess of which type the given filename is, avoid using this if possible """
@@ -289,7 +286,7 @@ class Manifest(object):
                        distfilehashes = self.fhashdict["DIST"]
                else:
                        distfilehashes = {}
-               self.__init__(self.pkgdir, self.db, self.mysettings, from_scratch=True)
+               self.__init__(self.pkgdir, self.db, self.mysettings, self.distdir, from_scratch=True)
                for pkgdir, pkgdir_dirs, pkgdir_files in os.walk(self.pkgdir):
                        break
                for f in pkgdir_files: