Merged from trunk -r12057:12086
authorFabian Groffen <grobian@gentoo.org>
Mon, 1 Dec 2008 20:59:48 +0000 (20:59 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 1 Dec 2008 20:59:48 +0000 (20:59 -0000)
   | 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

bin/emaint
man/emerge.1
man/portage.5
pym/_emerge/__init__.py
pym/_emerge/help.py
pym/portage/__init__.py

index 8ec7cadd34c97aa68e874eb1a0a6a218a7b972bf..629948ddd12b4e924783a36f5a488a26be645de2 100755 (executable)
@@ -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"
index 6d0e6587ca96701a8d43e93c59671e3aa825f0ea..47df88c484957f8f471e380848bd6f1dfa5ea6c1 100644 (file)
@@ -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
index 2901faa84bca012bca6872e59af51b26ea83a620..c6fc61437f17a4324bc6d572784d7993005c77c5 100644 (file)
@@ -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 
index a1e24b7b3e82dd557121b858e8e0691992209ed9..1fb1c15fe0bf0a0cc55012a1c4068669c947ccc2 100644 (file)
@@ -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()
index 05a9803c929e8bbfb6c4910332b9a4d3e43ea652..bea1f13c02281c58270c76feff6ef2f07ce23554 100644 (file)
@@ -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
-
index 12c303ebb84e285802070c68363ab9bbe3f6f442..3288e17af358c712df4bddf6f29a5baace91e7a5 100644 (file)
@@ -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")