summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/repoman8
-rw-r--r--pym/_emerge/Scheduler.py2
-rw-r--r--pym/portage/__init__.py24
3 files changed, 23 insertions, 11 deletions
diff --git a/bin/repoman b/bin/repoman
index 17c928662..c1f1481d0 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1011,7 +1011,7 @@ for x in scanlist:
portage._doebuild_manifest_exempt_depend -= 1
repoman_settings["O"] = checkdir
- if not portage.digestgen([], repoman_settings, myportdb=portdb):
+ if not portage.digestgen(mysettings=repoman_settings, myportdb=portdb):
print("Unable to generate manifest.")
dofail = 1
if options.mode == "manifest":
@@ -2335,7 +2335,7 @@ else:
mydone=[]
if repolevel==3: # In a package dir
repoman_settings["O"] = startdir
- portage.digestgen([], repoman_settings, myportdb=portdb)
+ portage.digestgen(mysettings=repoman_settings, myportdb=portdb)
elif repolevel==2: # In a category dir
for x in myfiles:
xs=x.split("/")
@@ -2349,7 +2349,7 @@ else:
repoman_settings["O"] = os.path.join(startdir, xs[0])
if not os.path.isdir(repoman_settings["O"]):
continue
- portage.digestgen([], repoman_settings, myportdb=portdb)
+ portage.digestgen(mysettings=repoman_settings, myportdb=portdb)
elif repolevel==1: # repo-cvsroot
print(green("RepoMan sez:"), "\"You're rather crazy... doing the entire repository.\"\n")
for x in myfiles:
@@ -2364,7 +2364,7 @@ else:
repoman_settings["O"] = os.path.join(startdir, xs[0], xs[1])
if not os.path.isdir(repoman_settings["O"]):
continue
- portage.digestgen([], repoman_settings, myportdb=portdb)
+ portage.digestgen(mysettings=repoman_settings, myportdb=portdb)
else:
print(red("I'm confused... I don't know where I am!"))
sys.exit(1)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index c760c395e..e508e233f 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -591,7 +591,7 @@ class Scheduler(PollScheduler):
if ebuild_path is None:
raise AssertionError("ebuild not found for '%s'" % x.cpv)
pkgsettings['O'] = os.path.dirname(ebuild_path)
- if not portage.digestgen([], pkgsettings, myportdb=portdb):
+ if not portage.digestgen(mysettings=pkgsettings, myportdb=portdb):
writemsg_level(
"!!! Unable to generate manifest for '%s'.\n" \
% x.cpv, level=logging.ERROR, noiselevel=-1)
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 1b8427c34..b28658f57 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1376,10 +1376,23 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
return retval >> 8
return retval
-def digestgen(myarchives, mysettings, overwrite=None, manifestonly=None, myportdb=None):
+def digestgen(myarchives=None, mysettings=None,
+ overwrite=None, manifestonly=None, myportdb=None):
"""
Generates a digest file if missing. Fetches files if necessary.
+ NOTE: myarchives and mysettings used to be positional arguments,
+ so their order must be preserved for backward compatibility.
+ @param mysettings: the ebuild config (mysettings["O"] must correspond
+ to the ebuild's parent directory)
+ @type mysettings: config
+ @param myportdb: a portdbapi instance
+ @type myportdb: portdbapi
+ @rtype: int
+ @returns: 1 on success and 0 on failure
"""
+ if mysettings is None:
+ raise TypeError("portage.digestgen(): missing" + \
+ " required 'mysettings' parameter")
if myportdb is None:
warnings.warn("portage.digestgen() called without 'myportdb' parameter",
DeprecationWarning, stacklevel=2)
@@ -1500,8 +1513,7 @@ def digestgen(myarchives, mysettings, overwrite=None, manifestonly=None, myportd
return 0
writemsg_stdout(_(">>> Creating Manifest for %s\n") % mysettings["O"])
try:
- mf.create(requiredDistfiles=myarchives,
- assumeDistHashesSometimes=True,
+ mf.create(assumeDistHashesSometimes=True,
assumeDistHashesAlways=(
"assume-digests" in mysettings.features))
except portage.exception.FileNotFound as e:
@@ -3360,15 +3372,15 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
try:
if mydo == "manifest":
- return not digestgen(aalist, mysettings, myportdb=mydbapi)
+ return not digestgen(mysettings=mysettings, myportdb=mydbapi)
elif mydo == "digest":
- return not digestgen(aalist, mysettings, myportdb=mydbapi)
+ return not digestgen(mysettings=mysettings, myportdb=mydbapi)
elif mydo != 'fetch' and not emerge_skip_digest and \
"digest" in mysettings.features:
# Don't do this when called by emerge or when called just
# for fetch (especially parallel-fetch) since it's not needed
# and it can interfere with parallel tasks.
- digestgen(aalist, mysettings, myportdb=mydbapi)
+ digestgen(mysettings=mysettings, myportdb=mydbapi)
except portage.exception.PermissionDenied as e:
writemsg(_("!!! Permission Denied: %s\n") % (e,), noiselevel=-1)
if mydo in ("digest", "manifest"):