Merged from trunk 5165:5171
authorFabian Groffen <grobian@gentoo.org>
Mon, 4 Dec 2006 20:35:50 +0000 (20:35 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 4 Dec 2006 20:35:50 +0000 (20:35 -0000)
When portdbapi.aux_get() generates a KeyError in
portage.getmaskingstatus(), handle it by reporting "corruption".

Make `repoman fix` work with the new ebuild Manifest checks during
depend phase.

Update the RESTRICT=binchecks docs.  Thanks to jakub for the suggestion
and antarus for the patch.

For `ebuild --force digest`, exempt the depend phase from Manifest
checks.

Use portage.chdir() instead of os.chdir() in order to avoid an 'OSError:
[Errno 2] No such file or directory' if the working directory doesn't
exist.  Thanks to Caster for reporting.

svn path=/main/branches/prefix/; revision=5172

bin/ebuild
bin/repoman
man/ebuild.5
pym/portage.py

index 4452ab3c83c8575b707991cf7dae2c865557dd4e..6a73dce16094536b3326b397164c8abc12ebb4d2 100755 (executable)
@@ -88,22 +88,26 @@ def discard_digests(myebuild, mysettings, mydbapi):
        upstream has changed the identity of the distfiles and the user would
        otherwise have to manually remove the Manifest and files/digest-* files in
        order to ensure correct results."""
-       pkgdir = os.path.dirname(myebuild)
-       fetchlist_dict = portage.FetchlistDict(pkgdir, mysettings, mydbapi)
-       cat, pkg = pkgdir.split(os.sep)[-2:]
-       cpv = cat + "/" + os.path.basename(myebuild)[:-7]
-       from portage_manifest import Manifest
-       mf = Manifest(pkgdir, mysettings["DISTDIR"],
-               fetchlist_dict=fetchlist_dict)
-       mf.create(requiredDistfiles=None,
-               assumeDistHashesSometimes=True, assumeDistHashesAlways=True)
-       distfiles = fetchlist_dict[cpv]
-       for myfile in distfiles:
-               try:
-                       del mf.fhashdict["DIST"][myfile]
-               except KeyError:
-                       pass
-       mf.write()
+       try:
+               portage._doebuild_manifest_exempt_depend += 1
+               pkgdir = os.path.dirname(myebuild)
+               fetchlist_dict = portage.FetchlistDict(pkgdir, mysettings, mydbapi)
+               cat, pkg = pkgdir.split(os.sep)[-2:]
+               cpv = cat + "/" + os.path.basename(myebuild)[:-7]
+               from portage_manifest import Manifest
+               mf = Manifest(pkgdir, mysettings["DISTDIR"],
+                       fetchlist_dict=fetchlist_dict)
+               mf.create(requiredDistfiles=None,
+                       assumeDistHashesSometimes=True, assumeDistHashesAlways=True)
+               distfiles = fetchlist_dict[cpv]
+               for myfile in distfiles:
+                       try:
+                               del mf.fhashdict["DIST"][myfile]
+                       except KeyError:
+                               pass
+               mf.write()
+       finally:
+               portage._doebuild_manifest_exempt_depend -= 1
 
 for arg in pargs:
        try:
index 8ae13066d0b6e3260d2baa9bbaf3eb69bdb6b571..12a53b30077fdaf6428fec876debc9352bcb0d55 100755 (executable)
@@ -942,7 +942,7 @@ for x in scanlist:
                                fails["svn.IO_error"].append(checkdir+"/files svn info")
                        continue
 
-       if mymode == "commit":
+       if mymode in ("fix", "commit"):
                repoman_settings["O"] = checkdir
                portage.digestgen(
                        [], repoman_settings, manifestonly=1, myportdb=portdb)
index 40aed0410970daf8b25f51f443c367d68f38bc8b..9e2243a59d0cda1df2051f77731c5c6d6ad0e7f3 100644 (file)
@@ -320,8 +320,11 @@ This should be a space delimited list of portage features to restrict.
 .RS
 .TP
 .I binchecks
-Disable all QA checks for binaries (do not use without very good reason).  See
-the \fBQA CONTROL VARIABLES\fR section for more specific exemptions.
+Disable all QA checks for binaries.  This should ONLY be used in packages
+for which binary checks make no sense (linux-headers and kernel-sources, for
+example, can safely be skipped since they have no binaries).  If the binary
+checks need to be skipped for other reasons (such as proprietary binaries),
+see the \fBQA CONTROL VARIABLES\fR section for more specific exemptions.
 .TP
 .I confcache
 Prevent econf from using confcache.
index c570012e6acb6d646a29f5398dd1be813aedf5c1..84a5f308656c7522ac40403e0e54b98ee134e715 100644 (file)
@@ -4135,7 +4135,12 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
                                        rValue.append("package.mask")
 
        # keywords checking
-       mygroups, eapi = portdb.aux_get(mycpv, ["KEYWORDS", "EAPI"])
+       try:
+               mygroups, eapi = portdb.aux_get(mycpv, ["KEYWORDS", "EAPI"])
+       except KeyError:
+               # The "depend" phase apparently failed for some reason.  An associated
+               # error message will have already been printed to stderr.
+               return ["corruption"]
        if not eapi_is_supported(eapi):
                return ["required EAPI %s, supported EAPI %s" % (eapi, portage_const.EAPI)]
        mygroups = mygroups.split()
@@ -6556,7 +6561,7 @@ class dblink:
                        myfilelist = listdir(srcroot, recursive=1, filesonly=1, followSymlinks=False)
 
                        # the linkcheck only works if we are in srcroot
-                       mycwd = os.getcwd()
+                       mycwd = getcwd()
                        os.chdir(srcroot)
                        mysymlinks = filter(os.path.islink, listdir(srcroot, recursive=1, filesonly=0, followSymlinks=False))
                        myfilelist.extend(mysymlinks)