myebuild = portage.portdb.findname(mycpv)
pkgdir = os.path.dirname(myebuild)
import portage_manifest
- mf = portage_manifest.Manifest(pkgdir,
- portage.FetchlistDict(pkgdir, portage.settings, portage.portdb),
- portage.settings["DISTDIR"])
- mysum[0] = mf.getDistfilesSize(mf.fetchlist_dict[mycpv])
+ mf = portage_manifest.Manifest(
+ pkgdir, portage.settings["DISTDIR"])
+ fetchlist = portage.portdb.getfetchlist(mycpv,
+ mysettings=portage.settings, all=True)
+ mysum[0] = mf.getDistfilesSize(fetchlist)
mystr = str(mysum[0]/1024)
mycount=len(mystr)
while (mycount > 3):
repoman_settings["O"] = checkdir
portage.digestgen([], repoman_settings, manifestonly=1, myportdb=portage.portdb)
- mf = Manifest(checkdir,
- portage.FetchlistDict(checkdir, repoman_settings, portage.portdb),
- repoman_settings["DISTDIR"])
+ mf = Manifest(checkdir, repoman_settings["DISTDIR"])
mydigests=mf.getTypeDigests("DIST")
myfiles_all = []
writemsg("Warning: myportdb not specified to digestgen\n")
global portdb
myportdb = portdb
- mf = Manifest(mysettings["O"], FetchlistDict(mysettings["O"], mysettings, myportdb), mysettings["DISTDIR"])
+ mf = Manifest(mysettings["O"], mysettings["DISTDIR"],
+ fetchlist_dict=FetchlistDict(mysettings["O"], mysettings, myportdb))
writemsg(">>> Creating Manifest for %s\n" % mysettings["O"])
try:
mf.create(assumeDistfileHashes=True, requiredDistfiles=myarchives)
if mysettings is None:
global settings
mysettings = config(clone=settings)
- global portdb
- mf = Manifest(pkgdir, FetchlistDict(pkgdir, mysettings, portdb), mysettings["DISTDIR"])
- return mf.getDigests()
+ return Manifest(pkgdir, mysettings["DISTDIR"]).getDigests()
# XXXX strict was added here to fix a missing name error.
# XXXX It's used below, but we're not paying attention to how we get it?
writemsg("!!! Manifest file not found: '%s'\n" % manifest_path)
if strict:
return 0
- global portdb
- mf = Manifest(pkgdir, FetchlistDict(pkgdir, mysettings, portdb), mysettings["DISTDIR"])
+ mf = Manifest(pkgdir, mysettings["DISTDIR"])
try:
writemsg_stdout(">>> checking ebuild checksums\n")
mf.checkTypeHashes("EBUILD")
# returns a filename:size dictionnary of remaining downloads
myebuild = self.findname(mypkg)
pkgdir = os.path.dirname(myebuild)
- mf = Manifest(pkgdir, FetchlistDict(pkgdir, self.mysettings, self), self.mysettings["DISTDIR"])
+ mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
checksums = mf.getDigests()
if not checksums:
if debug: print "[empty/missing/bad digest]: "+mypkg
myuri, myfiles = self.getfetchlist(mypkg, useflags=useflags, mysettings=mysettings, all=all)
myebuild = self.findname(mypkg)
pkgdir = os.path.dirname(myebuild)
- mf = Manifest(pkgdir, FetchlistDict(pkgdir, self.mysettings, self), self.mysettings["DISTDIR"])
+ mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
mysums = mf.getDigests()
failures = {}
class Manifest(object):
parsers = (parseManifest2, parseManifest1)
- def __init__(self, pkgdir, fetchlist_dict, distdir, manifest1_compat=True, from_scratch=False):
+ def __init__(self, pkgdir, distdir, fetchlist_dict=None,
+ manifest1_compat=True, from_scratch=False):
""" create new Manifest instance for package in pkgdir
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) """
+ Do not parse Manifest file if from_scratch == True (only for internal use)
+ The fetchlist_dict parameter is required only for generation of
+ a Manifest (not needed for parsing and checking sums)."""
self.pkgdir = pkgdir.rstrip(os.sep) + os.sep
self.fhashdict = {}
self.hashes = portage_const.MANIFEST2_HASH_FUNCTIONS[:]
distfilehashes = self.fhashdict["DIST"]
else:
distfilehashes = {}
- self.__init__(self.pkgdir, self.fetchlist_dict, self.distdir, from_scratch=True)
+ self.__init__(self.pkgdir, self.distdir,
+ fetchlist_dict=self.fetchlist_dict, from_scratch=True)
for pkgdir, pkgdir_dirs, pkgdir_files in os.walk(self.pkgdir):
break
for f in pkgdir_files: