From: Fabian Groffen Date: Mon, 4 Dec 2006 20:35:50 +0000 (-0000) Subject: Merged from trunk 5165:5171 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a344bffa65ac6d77c198be3d291cd0224df7f62e;p=portage.git Merged from trunk 5165:5171 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 --- diff --git a/bin/ebuild b/bin/ebuild index 4452ab3c8..6a73dce16 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -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: diff --git a/bin/repoman b/bin/repoman index 8ae13066d..12a53b300 100755 --- a/bin/repoman +++ b/bin/repoman @@ -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) diff --git a/man/ebuild.5 b/man/ebuild.5 index 40aed0410..9e2243a59 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -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. diff --git a/pym/portage.py b/pym/portage.py index c570012e6..84a5f3086 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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)