From 815fca9ec0df38c781130008d36bcf3f7ad3fb89 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 7 Oct 2009 19:12:18 +0000 Subject: [PATCH] Merged from trunk -r14497:14507 | 14498 | Enable FEATURES=news by default and document it. | | zmedico | | | 14499 | When restarting emerge, don't trust sys.argv[0] since | | zmedico | eselect-python may modify it. | | 14500 | Add a 'digest.missing' check, for cases like mythtv where | | zmedico | the eclass has modified the SRC_URI and now the Manifest has | | | missing digests. Thanks to Brian Harring for the suggestion. | | 14501 | Add a new --accept-properties option so that users can | | zmedico | temporarily override ACCEPT_PROPERTIES on the commandline, | | | without relying on emerge's legacy behavior of allowing | | | variables to leak in from the calling environment. A typical | | | usage example for this option would be to use | | | --accept-properties=-interactive to temporarily mask | | | interactive packages. With default configuration, this would | | | result in an effective ACCEPT_PROPERTIES value of "* | | | -interactive". | | 14502 | Add a note about --accept-properties and exclusion of | | zmedico | interactive updates. | | 14504 | Bug #287870 - Add -r option as short version of --resume. | | zmedico | | | 14505 | Fix collision in variable name 'x'. | | zmedico | | | 14506 | Exempt installed packages from PROPERTIES masking since the | | zmedico | user is likely to temporarily alter ACCEPT_PROPERIES in | | | order to avoid interactive updates and we don't want this to | | | distort resolver choices or trigger warning messages about | | | installed packages being masked. | | 14507 | Bug #265267 - When disabling --jobs due to interactive | | zmedico | package(s), hint about --accept-properties=-interactive | | | option. | svn path=/main/branches/prefix/; revision=14512 --- NEWS | 3 +++ bin/repoman | 19 +++++++++++++------ cnf/make.globals | 2 +- man/emerge.1 | 19 +++++++++++++++++-- man/make.conf.5 | 8 +++++++- man/repoman.1 | 6 ++++++ pym/_emerge/Scheduler.py | 9 +++++++-- pym/_emerge/help.py | 20 ++++++++++++++++++-- pym/_emerge/main.py | 7 +++++++ pym/_emerge/visible.py | 8 +++++--- 10 files changed, 84 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index a64b40602..d9034e264 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ portage-2.2 in order to protect against uninstallation of required libraries. * Add license visibility filtering (GLEP 23) * Add support for generic package sets (also see RELEASE-NOTES) +* Add --accept-properties option for emerge which allows you to use + --accept-properties=-interactive in order to temporarily exclude + interactive updates. portage-2.1.6 ------------- diff --git a/bin/repoman b/bin/repoman index db079f491..a71e7f6a8 100755 --- a/bin/repoman +++ b/bin/repoman @@ -312,7 +312,9 @@ qahelp={ "RDEPEND.implicit":"RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND assignment", "RDEPEND.suspect":"RDEPEND contains a package that usually only belongs in DEPEND.", "RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.", - "digestentry.unused":"Some files listed in the Manifest aren't referenced in SRC_URI", + "digest.assumed":"Existing digest must be assumed correct (Package level only)", + "digest.missing":"Some files listed in SRC_URI aren't referenced in the Manifest", + "digest.unused":"Some files listed in the Manifest aren't referenced in SRC_URI", "ebuild.nostable":"There are no ebuilds that are marked as stable for your ARCH", "ebuild.allmasked":"All ebuilds are masked for this package (Package level only)", "ebuild.majorsyn":"This ebuild has a major syntax error that may cause the ebuild to fail partially or fully", @@ -335,7 +337,8 @@ qawarnings = set(( "changelog.ebuildadded", "changelog.missing", "changelog.notadded", -"digestentry.unused", +"digest.assumed", +"digest.unused", "ebuild.notadded", "ebuild.nostable", "ebuild.allmasked", @@ -1094,8 +1097,12 @@ for x in scanlist: myfiles_all = set(myfiles_all) for entry in mydigests: if entry not in myfiles_all: - stats["digestentry.unused"] += 1 - fails["digestentry.unused"].append(checkdir+"::"+entry) + stats["digest.unused"] += 1 + fails["digest.unused"].append(checkdir+"::"+entry) + for entry in myfiles_all: + if entry not in mydigests: + stats["digest.missing"] += 1 + fails["digest.missing"].append(checkdir+"::"+entry) del myfiles_all if os.path.exists(checkdir+"/files"): @@ -1496,8 +1503,8 @@ for x in scanlist: stats[m+".syntax"] += 1 fails[m+".syntax"].append(catpkg+".ebuild "+m+": "+b) - badlicsyntax = len([x for x in type_list if x == "LICENSE"]) - badprovsyntax = len([x for x in type_list if x == "PROVIDE"]) + badlicsyntax = len([z for z in type_list if z == "LICENSE"]) + badprovsyntax = len([z for z in type_list if z == "PROVIDE"]) baddepsyntax = len(type_list) != badlicsyntax + badprovsyntax badlicsyntax = badlicsyntax > 0 badprovsyntax = badprovsyntax > 0 diff --git a/cnf/make.globals b/cnf/make.globals index c2bd3f0f8..7f67ed0e4 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -41,7 +41,7 @@ FETCHCOMMAND="@PORTAGE_WGET@ -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\ RESUMECOMMAND="@PORTAGE_WGET@ -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" # Default user options -FEATURES="assume-digests distlocks fixpackages parallel-fetch protect-owned +FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch" # Ignore file collisions in /lib/modules since files inside this directory diff --git a/man/emerge.1 b/man/emerge.1 index 683af7e38..f8d205930 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -182,7 +182,7 @@ a sync operation. In order to specify parallel \fB\-\-regen\fR behavior, use the \fB\-\-jobs\fR and \fB\-\-load\-average\fR options. If you would like to generate and distribute cache for use by others, use \fBegencache\fR(1). .TP -.BR "\-\-resume" +.BR "\-\-resume" (\fB\-r\fR) Resumes the most recent merge list that has been aborted due to an error. Please note that this operation will only return an error on failure. If there is nothing for portage to do, then portage will exit with a message and a @@ -234,6 +234,20 @@ match multiple installed versions of slotted packages. Displays the version number of \fBemerge\fR. .SH "OPTIONS" .TP +.BR \-\-accept\-properties=ACCEPT_PROPERTIES +This option temporarily overrides the \fBACCEPT_PROPERTIES\fR +variable. The \fBACCEPT_PROPERTIES\fR variable is incremental, +which means that the specified setting is appended to the +existing value from your configuration. The special \fB-*\fR +token can be used to discard the existing configuration +value and start fresh. See the \fBMASKED PACKAGES\fR section +and \fBmake.conf\fR(5) for more information about +ACCEPT_PROPERTIES. A typical usage example for this option +would be to use \fI\-\-accept\-properties=-interactive\fR to +temporarily mask interactive packages. With default +configuration, this would result in an effective +\fBACCEPT_PROPERTIES\fR value of "* -interactive". +.TP .BR "\-\-alphabetical " When displaying USE and other flag output, combines the enabled and disabled lists into one list and sorts the whole list alphabetically. @@ -667,7 +681,8 @@ packages based on properties restrictions. \fBemerge\fR examines the \fBACCEPT_PROPERTIES\fR environment variable to allow or disallow the emerging of a package masked by \fBPROPERTIES\fR. See \fBmake.conf\fR(5) for information about \fBACCEPT_PROPERTIES\fR, and see \fBportage\fR(5) for information about -\fI/etc/portage/package.properties\fR. +\fI/etc/portage/package.properties\fR. Use the \fB\-\-accept\-properties\fR +option to temporarily override \fBACCEPT_PROPERTIES\fR. .SH "CONFIGURATION FILES" Portage has a special feature called "config file protection". The purpose of this feature is to prevent new package installs from clobbering existing diff --git a/man/make.conf.5 b/man/make.conf.5 index be4b1ab9d..c0b48e924 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -43,7 +43,9 @@ Defaults to the value of * -@EULA. .TP \fBACCEPT_PROPERTIES\fR = \fI[space delimited list of properties]\fR This variable is used to mask packages based on PROPERTIES restrictions. -See \fBebuild\fR(5) for more information about PROPERTIES. +This varable can be temporarily overridden using the the +\fB\-\-accept\-properties\fR option of \fBemerge\fR(1). +See \fBebuild\fR(5) for more information about PROPERTIES. .br Defaults to the value of *. .TP @@ -266,6 +268,10 @@ isn't a symlink to /usr/lib64. To find the bad packages, we have a portage feature called \fImultilib\-strict\fR. It will prevent emerge from putting 64bit libraries into anything other than (/usr)/lib64. .TP +.B news +Enable GLEP 42 new support. See +\fIhttp://www.gentoo.org/proj/en/glep/glep-0042.html\fR. +.TP .B noauto When utilizing \fBebuild\fR(1), only run the function requested. .TP diff --git a/man/repoman.1 b/man/repoman.1 index b07427749..dbb214d31 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -216,6 +216,12 @@ ChangeLogs that exist but have not been added to cvs .B digest.assumed Existing digest must be assumed correct (Package level only) .TP +.B digest.missing +Some files listed in SRC_URI aren't referenced in the Manifest +.TP +.B digest.unused +Some files listed in the Manifest aren't referenced in SRC_URI +.TP .B ebuild.allmasked All ebuilds are masked for this package (Package level only) .TP diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index b6f08307d..00c27925b 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -309,7 +309,10 @@ class Scheduler(PollScheduler): writemsg_level(">>> Setting --jobs=1 due " + \ "to the above interactive package(s)\n", level=logging.INFO, noiselevel=-1) - + writemsg_level(">>> In order to temporarily mask " + \ + "interactive updates, you may\n" + \ + ">>> specify --accept-properties=-interactive\n", + level=logging.INFO, noiselevel=-1) self._status_display.quiet = \ not background or \ ("--quiet" in self.myopts and \ @@ -753,7 +756,9 @@ class Scheduler(PollScheduler): mtimedb["resume"]["mergelist"].remove(list(pkg)) mtimedb.commit() portage.run_exitfuncs() - mynewargv = [sys.argv[0], "--resume"] + # Don't trust sys.argv[0] here because eselect-python may modify it. + emerge_binary = os.path.join(portage.const.PORTAGE_BIN_PATH, 'emerge') + mynewargv = [emerge_binary, "--resume"] resume_opts = self.myopts.copy() # For automatic resume, we need to prevent # any of bad_resume_opts from leaking in diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py index f34691682..5875cc29d 100644 --- a/pym/_emerge/help.py +++ b/pym/_emerge/help.py @@ -14,7 +14,7 @@ def shorthelp(): print(" "+turquoise("emerge")+" < "+turquoise("--sync")+" | "+turquoise("--metadata")+" | "+turquoise("--info")+" >") print(" "+turquoise("emerge")+" "+turquoise("--resume")+" [ "+green("--pretend")+" | "+green("--ask")+" | "+green("--skipfirst")+" ]") print(" "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("--verbose")+" ] ") - print(bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhjkKlnNoOpqPsStuvV")+"]") + print(bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhjkKlnNoOpPqrsStuvV")+"]") print(" [ " + green("--color")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ] [ "+green("--columns")+" ]") print(" [ "+green("--complete-graph")+" ] [ "+green("--deep")+" ]") print(" [ "+green("--jobs") + " " + turquoise("JOBS")+" ] [ "+green("--keep-going")+" ] [ " + green("--load-average")+" " + turquoise("LOAD") + " ]") @@ -161,7 +161,7 @@ def help(myopts, havecolor=1): for line in wrap(desc, desc_width): print(desc_indent + line) print() - print(" "+green("--resume")) + print(" "+green("--resume")+" ("+green("-r")+" short option)") print(" Resumes the most recent merge list that has been aborted due to an") print(" error. Please note that this operation will only return an error") print(" on failure. If there is nothing for portage to do, then portage") @@ -232,6 +232,22 @@ def help(myopts, havecolor=1): print(" "+bold("emerge info")+" for more advanced information.") print() print(turquoise("Options:")) + print(" "+green("--accept-properties=ACCEPT_PROPERTIES")) + desc = "This option temporarily overrides the ACCEPT_PROPERTIES " + \ + "variable. The ACCEPT_PROPERTIES variable is incremental, " + \ + "which means that the specified setting is appended to the " + \ + "existing value from your configuration. The special -* " + \ + "token can be used to discard the existing configuration " + \ + "value and start fresh. See the MASKED PACKAGES section " + \ + "and make.conf(5) for more information about " + \ + "ACCEPT_PROPERTIES. A typical usage example for this option " + \ + "would be to use --accept-properties=-interactive to " + \ + "temporarily mask interactive packages. With default " + \ + "configuration, this would result in an effective " + \ + "ACCEPT_PROPERTIES value of \"* -interactive\"." + for line in wrap(desc, desc_width): + print(desc_indent + line) + print() print(" "+green("--alphabetical")) print(" When displaying USE and other flag output, combines the enabled") print(" and disabled flags into a single list and sorts it alphabetically.") diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 1ff4c3af7..9114322ae 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -84,6 +84,7 @@ shortmapping={ "o":"--onlydeps", "O":"--nodeps", "p":"--pretend", "P":"--prune", "q":"--quiet", +"r":"--resume", "s":"--search", "S":"--searchdesc", "t":"--tree", "u":"--update", @@ -499,6 +500,10 @@ def parse_opts(tmpcmdline, silent=False): longopt_aliases = {"--cols":"--columns", "--skip-first":"--skipfirst"} argument_options = { + "--accept-properties": { + "help":"temporarily override ACCEPT_PROPERTIES", + "action":"store" + }, "--config-root": { "help":"specify the location for portage configuration files", "action":"store" @@ -1048,6 +1053,8 @@ def emerge_main(): os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"] if "--root" in myopts: os.environ["ROOT"] = myopts["--root"] + if "--accept-properties" in myopts: + os.environ["ACCEPT_PROPERTIES"] = myopts["--accept-properties"] # Portage needs to ensure a sane umask for the files it creates. os.umask(0o22) diff --git a/pym/_emerge/visible.py b/pym/_emerge/visible.py index 4542e1c97..3978c1714 100644 --- a/pym/_emerge/visible.py +++ b/pym/_emerge/visible.py @@ -33,6 +33,11 @@ def visible(pkgsettings, pkg): return False if pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata): return False + try: + if pkgsettings._getMissingProperties(pkg.cpv, pkg.metadata): + return False + except portage.exception.InvalidDependString: + return False if pkgsettings._getMaskAtom(pkg.cpv, pkg.metadata): return False if pkgsettings._getProfileMaskAtom(pkg.cpv, pkg.metadata): @@ -40,9 +45,6 @@ def visible(pkgsettings, pkg): try: if pkgsettings._getMissingLicenses(pkg.cpv, pkg.metadata): return False - if pkgsettings._getMissingProperties(pkg.cpv, pkg.metadata): - return False except portage.exception.InvalidDependString: return False return True - -- 2.26.2