From: Fabian Groffen Date: Mon, 1 Dec 2008 20:59:48 +0000 (-0000) Subject: Merged from trunk -r12057:12086 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=7b5d0783236b7a5817e87945b057733131b339a0;p=portage.git Merged from trunk -r12057:12086 | 12059 | Document "I" which represents PROPERTIES=interactive in the | | zmedico | merge list display. | | 12061 | Use a table to organize the key of merge list display codes | | zmedico | for the --pretend option. | | 12063 | Use a table to organize the key of USE flag symbols for the | | zmedico | --verbose option. | | 12065 | Make emerge detect an invalid profile an bail out for | | zmedico | anything except --help, --info, --sync, and --version | | | actions. When bailing out, suggest to revert back to the | | | previous profile configuration advise the user which actions | | | are allowed with an invalid profile. | | 12066 | Inside profile_check(), call validate_ebuild_environment() | | zmedico | to generate some extra profile warnings when appropriate. | | 12068 | Add support for parsing EAPI labels in contained in 'eapi' | | zmedico | files in the profiles, and bail out if the profile contains | | | an unsupported EAPI value in any one of it's directories. We | | | don't necessarily have to use this but at least it gives us | | | some way to make emerge bail out early if a profile contains | | | unsupported EAPI features. | | 12070 | Document the 'eapi' profile file. | | zmedico | | | 12072 | Fix typo in --help. | | zmedico | | | 12077 | Add one newline, to wrap the "Global Updates" key to less | | zmedico | than 80 columns. | | 12079 | Also add 2 spaces after newline, for alignment. | | zmedico | | | 12081 | Use tar options to make files owned in release tarballs | | zmedico | owned by portage:portage instead of the current user. | | 12086 | Remove world and system targets for emerge --help since it | | zmedico | no longer works now that they are sets rather than actions. | svn path=/main/branches/prefix/; revision=12131 --- diff --git a/bin/emaint b/bin/emaint index 8ec7cadd3..629948ddd 100755 --- a/bin/emaint +++ b/bin/emaint @@ -502,7 +502,7 @@ def emaint_main(myargv): usage = "usage: emaint [options] COMMAND" desc = "The emaint program provides an interface to system health " + \ - "checks and maintenance. See the emaint(1) man page for " + \ + "checks and maintenance. See the emaint(1) man page " + \ "for additional information about the following commands:" usage += "\n\n" diff --git a/man/emerge.1 b/man/emerge.1 index 6d0e6587c..47df88c48 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -16,7 +16,7 @@ emerge \- Command\-line interface to the Portage system \fB\-\-search\fR \fIsomestring\fR .TP .BR emerge -\fB\-\-help\fR [\fBsystem\fR | \fBworld\fR | \fB\-\-sync\fR] +\fB\-\-help\fR [\fB\-\-sync\fR] .SH "DESCRIPTION" \fBemerge\fR is the definitive command\-line interface to the Portage system. It is primarily used for installing packages, and \fBemerge\fR @@ -394,24 +394,19 @@ Instead of actually performing the merge, simply display what *would* have been installed if \fB\-\-pretend\fR weren't used. Using \fB\-\-pretend\fR is strongly recommended before installing an unfamiliar package. In the printout: -.br - -.br -\fIN\fR = new (not yet installed) -.br -\fIS\fR = new SLOT installation (side-by-side versions) -.br -\fIU\fR = updating (to another version) -.br -\fID\fR = downgrading (best version seems lower) -.br -\fIR\fR = replacing (remerging same version)) -.br -\fIF\fR = fetch restricted (must be manually downloaded) -.br -\fIf\fR = fetch restricted (already downloaded) -.br -\fIB\fR = blocked by an already installed package + +.TS +lI l. +N new (not yet installed) +S new SLOT installation (side-by-side versions) +U updating (to another version) +D downgrading (best version seems lower) +R replacing (remerging same version)) +F fetch restricted (must be manually downloaded) +f fetch restricted (already downloaded) +I interactive (requires user input) +B blocked by an already installed package +.TE .TP .BR "\-\-quiet " (\fB\-q\fR) Results may vary, but the general outcome is a reduced or condensed @@ -452,16 +447,18 @@ Tell emerge to run in verbose mode. Currently this flag causes emerge to print out GNU info errors, if any, and to show the USE flags that will be used for each package when pretending. The following symbols are affixed to USE flags in order to indicate their status: -.br -.br -\fI- prefix\fR = not enabled (either disabled or removed) -.br -\fI* suffix\fR = transition to or from the enabled state -.br -\fI% suffix\fR = newly added or removed -.br -\fI() circumfix\fR = forced, masked, or removed +.TS +l l l +___ +l l l. +Symbol Location Meaning + +- prefix not enabled (either disabled or removed) +* suffix transition to or from the enabled state +% suffix newly added or removed +() circumfix forced, masked, or removed +.TE .TP .BR "\-\-with\-bdeps < y | n >" In dependency calculations, pull in build time dependencies diff --git a/man/portage.5 b/man/portage.5 index 2901faa84..c6fc61437 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -25,6 +25,7 @@ make.globals site\-specific overrides go in \fB/etc/portage/profile/\fR .nf deprecated +eapi make.defaults packages packages.build @@ -150,6 +151,11 @@ default-linux/x86/2005.0 # ln -s /usr/portage/profiles/default-linux/alpha/2005.0 /etc/make.profile .fi .TP +.BR eapi +The first line of this file specifies the \fBEAPI\fR to which files in the +same directory conform. See \fBebuild\fR(5) for information about \fBEAPI\fR +and related features. +.TP .BR make.defaults The profile default settings for Portage. The general format is described in \fBmake.conf\fR(5). The \fImake.defaults\fR for your profile defines a diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index a1e24b7b3..1fb1c15fe 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -14015,6 +14015,25 @@ def ambiguous_package_name(arg, atoms, root_config, spinner, myopts): print "!!! The short ebuild name \"%s\" is ambiguous. Please specify" % arg print "!!! one of the above fully-qualified ebuild names instead.\n" +def profile_check(trees, myaction, myopts): + if myaction in ("info", "sync"): + return os.EX_OK + elif "--version" in myopts or "--help" in myopts: + return os.EX_OK + for root, root_trees in trees.iteritems(): + if root_trees["root_config"].settings.profiles: + continue + # generate some profile related warning messages + validate_ebuild_environment(trees) + msg = "If you have just changed your profile configuration, you " + \ + "should revert back to the previous configuration. Due to " + \ + "your current profile being invalid, allowed actions are " + \ + "limited to --help, --info, --sync, and --version." + writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)), + level=logging.ERROR, noiselevel=-1) + return 1 + return os.EX_OK + def emerge_main(): global portage # NFC why this is necessary now - genone portage._disable_legacy_globals() @@ -14035,6 +14054,9 @@ def emerge_main(): os.umask(022) settings, trees, mtimedb = load_emerge_config() portdb = trees[settings["ROOT"]]["porttree"].dbapi + rval = profile_check(trees, myaction, myopts) + if rval != os.EX_OK: + return rval if portage._global_updates(trees, mtimedb["updates"]): mtimedb.commit() diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py index 05a9803c9..bea1f13c0 100644 --- a/pym/_emerge/help.py +++ b/pym/_emerge/help.py @@ -463,32 +463,3 @@ def help(myaction,myopts,havecolor=1): print " exist on it, including ones that you may have created. The exceptions" print " to this are the distfiles, local and packages directories." print - elif myaction=="system": - print - print bold("Usage: ")+turquoise("emerge")+" [ "+green("options")+" ] "+turquoise("system") - print - print " \"emerge system\" is the Portage system update command. When run, it" - print " will scan the etc/make.profile/packages file and determine what" - print " packages need to be installed so that your system meets the minimum" - print " requirements of your current system profile. Note that this doesn't" - print " necessarily bring your system up-to-date at all; instead, it just" - print " ensures that you have no missing parts. For example, if your system" - print " profile specifies that you should have sys-apps/iptables installed" - print " and you don't, then \"emerge system\" will install it (the most" - print " recent version that matches the profile spec) for you. It's always a" - print " good idea to do an \"emerge --pretend system\" before an \"emerge" - print " system\", just so you know what emerge is planning to do." - print - elif myaction=="world": - print - print bold("Usage: ")+turquoise("emerge")+" [ "+green("options")+" ] "+turquoise("world") - print - print " 'emerge world' is the Portage command for completely updating your" - print " system. The normal procedure is to first do an 'emerge --sync' and" - print " then an 'emerge --update --deep world'. The first command brings your" - print " local Portage tree up-to-date with the latest version information and" - print " ebuilds. The second command then rebuilds all packages for which newer" - print " versions or newer ebuilds have become available since you last did a" - print " sync and update." - print - diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 12c303ebb..3288e17af 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1204,6 +1204,17 @@ class config(object): self.profiles = [] def addProfile(currentPath): parentsFile = os.path.join(currentPath, "parent") + eapi_file = os.path.join(currentPath, "eapi") + try: + eapi = open(eapi_file).readline().strip() + except IOError: + pass + else: + if not eapi_is_supported(eapi): + raise portage.exception.ParseError( + "Profile contains unsupported " + \ + "EAPI '%s': '%s'" % \ + (eapi, os.path.realpath(eapi_file),)) if os.path.exists(parentsFile): parents = grabfile(parentsFile) if not parents: @@ -1227,7 +1238,7 @@ class config(object): writemsg("!!! ParseError: %s\n" % str(e), noiselevel=-1) del e self.profiles = [] - if local_config: + if local_config and self.profiles: custom_prof = os.path.join( config_root, CUSTOM_PROFILE_PATH.lstrip(os.path.sep)) if os.path.exists(custom_prof): @@ -7328,7 +7339,7 @@ def _global_updates(trees, prev_mtimes): writemsg_stdout("\n\n") writemsg_stdout(green("Performing Global Updates: ")+bold(mykey)+"\n") writemsg_stdout("(Could take a couple of minutes if you have a lot of binary packages.)\n") - writemsg_stdout(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n"+" "+bold("s")+"='/var/db SLOT move' "+bold("%")+"='binary move' "+bold("S")+"='binary SLOT move' "+bold("p")+"='update /etc/portage/package.*'\n") + writemsg_stdout(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n"+" "+bold("s")+"='/var/db SLOT move' "+bold("%")+"='binary move' "+bold("S")+"='binary SLOT move'\n "+bold("p")+"='update /etc/portage/package.*'\n") valid_updates, errors = parse_updates(mycontent) myupd.extend(valid_updates) writemsg_stdout(len(valid_updates) * "." + "\n")