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
if mysettings is None:
mysettings = config(clone=settings)
- mf = Manifest(pkgdir, db, mysettings)
+ mf = Manifest(pkgdir, db, mysettings, mysettings["DISTDIR"])
return mf.getDigests()
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",
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
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 \
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) """
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 """
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: