Add deprecation warnings for unused digestgen() parameters. (trunk r15437)
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:58:04 +0000 (20:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:58:04 +0000 (20:58 -0000)
svn path=/main/branches/2.1.7/; revision=15652

bin/repoman
pym/portage/__init__.py

index 4229163394101dbe098797516645da4c8dfeb5af..c555523d6f93df9e853f0c2ba6edfa9e64a155f9 100755 (executable)
@@ -2335,8 +2335,7 @@ else:
                mydone=[]
                if repolevel==3:   # In a package dir
                        repoman_settings["O"] = startdir
-                       portage.digestgen([], repoman_settings, manifestonly=1,
-                               myportdb=portdb)
+                       portage.digestgen([], repoman_settings, myportdb=portdb)
                elif repolevel==2: # In a category dir
                        for x in myfiles:
                                xs=x.split("/")
@@ -2350,8 +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, manifestonly=1,
-                                       myportdb=portdb)
+                               portage.digestgen([], 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:
@@ -2366,8 +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, manifestonly=1,
-                                       myportdb=portdb)
+                               portage.digestgen([], repoman_settings, myportdb=portdb)
                else:
                        print(red("I'm confused... I don't know where I am!"))
                        sys.exit(1)
index aaa3f061604003df86fe33d39724c7f7edb41a1f..486b925afb3b0ce462a5c56466467654bcf767cb 100644 (file)
@@ -1376,17 +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=1, manifestonly=0, myportdb=None):
+def digestgen(myarchives, mysettings, overwrite=None, manifestonly=None, myportdb=None):
+       """
+       Generates a digest file if missing. Fetches files if necessary.
        """
-       Generates a digest file if missing.  Assumes all files are available.
-       DEPRECATED: this now only is a compability wrapper for 
-                   portage.manifest.Manifest()
-       NOTE: manifestonly and overwrite are useless with manifest2 and
-             are therefore ignored."""
        if myportdb is None:
-               writemsg("Warning: myportdb not specified to digestgen\n")
+               warnings.warn("portage.digestgen() called without 'myportdb' parameter",
+                       DeprecationWarning, stacklevel=2)
                global portdb
                myportdb = portdb
+       if overwrite is not None:
+               warnings.warn("portage.digestgen() called with " + \
+                       "deprecated 'overwrite' parameter",
+                       DeprecationWarning, stacklevel=2)
+       if manifestonly is not None:
+               warnings.warn("portage.digestgen() called with " + \
+                       "deprecated 'manifestonly' parameter",
+                       DeprecationWarning, stacklevel=2)
        global _doebuild_manifest_exempt_depend
        try:
                _doebuild_manifest_exempt_depend += 1
@@ -3354,17 +3360,15 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
 
                try:
                        if mydo == "manifest":
-                               return not digestgen(aalist, mysettings, overwrite=1,
-                                       manifestonly=1, myportdb=mydbapi)
+                               return not digestgen(aalist, mysettings, myportdb=mydbapi)
                        elif mydo == "digest":
-                               return not digestgen(aalist, mysettings, overwrite=1,
-                                       myportdb=mydbapi)
+                               return not digestgen(aalist, 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, overwrite=0, myportdb=mydbapi)
+                               digestgen(aalist, mysettings, myportdb=mydbapi)
                except portage.exception.PermissionDenied as e:
                        writemsg(_("!!! Permission Denied: %s\n") % (e,), noiselevel=-1)
                        if mydo in ("digest", "manifest"):