From 43a3f3f7e8a586bdec7f74fbe93f4a56c9b7b216 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 27 Oct 2006 21:51:36 +0000 Subject: [PATCH] Merged from trunk 4847:4855 Do not pass the "clean" parameter to doebuild since it causes ${T} to be cleaned up when it shouldn't be. Thanks to Mr_Bones_ for reporting. Don't bother to insert /usr/lib/portage/pym into sys.path from inside a module. That's the caller's job. Add --with-bdeps to emerge --help output. Update help for --deep. Update help for greedy behavior of --update. Add backward compatibility code for cache modules that override has_key instead of __contains__. svn path=/main/branches/prefix/; revision=4857 --- bin/ebuild | 3 ++- pym/cache/template.py | 9 ++++++++- pym/dispatch_conf.py | 1 - pym/emergehelp.py | 24 +++++++++++++++++------- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index d47c92582..be83ba5d5 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -106,7 +106,8 @@ for arg in pargs: tmpsettings = portage.config(clone=portage.settings) if arg == "digest" and force: discard_digests(ebuild, tmpsettings, portage.portdb) - a = portage.doebuild(ebuild, arg, portage.root, tmpsettings, debug=debug, cleanup=("noauto" not in portage.features), tree=mytree) + a = portage.doebuild(ebuild, arg, portage.root, tmpsettings, + debug=debug, tree=mytree) except KeyboardInterrupt: print "Interrupted." a = 1 diff --git a/pym/cache/template.py b/pym/cache/template.py index 5c72da286..7c2642f13 100644 --- a/pym/cache/template.py +++ b/pym/cache/template.py @@ -114,7 +114,14 @@ class database(object): raise NotImplementedError def __contains__(self, cpv): - raise NotImplementedError + """This method should always be overridden. It is provided only for + backward compatibility with modules that override has_key instead. It + will automatically raise a NotImplementedError if has_key has not been + overridden.""" + if self.has_key is database.has_key: + # prevent a possible recursive loop + raise NotImplementedError + return self.has_key(cpv) def get_matches(self, match_dict): """generic function for walking the entire cache db, matching restrictions to diff --git a/pym/dispatch_conf.py b/pym/dispatch_conf.py index e7a7da039..70c0a011d 100644 --- a/pym/dispatch_conf.py +++ b/pym/dispatch_conf.py @@ -10,7 +10,6 @@ from stat import * import os, sys, commands, shutil -sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym")) import portage RCS_BRANCH = '1.1.1' diff --git a/pym/emergehelp.py b/pym/emergehelp.py index 9b1c9032a..c6c0e465d 100644 --- a/pym/emergehelp.py +++ b/pym/emergehelp.py @@ -17,6 +17,7 @@ def shorthelp(): print " "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("system")+" | "+green("world")+" | "+green("config")+" | "+green("--sync")+" ] " print bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhikKlnNoOpqPsStuvV")+"] ["+green("--oneshot")+"] ["+green("--newuse")+"] ["+green("--noconfmem")+"]" print " ["+green("--columns")+"] ["+green("--nocolor")+"] ["+green("--nospinner")+"]" + print " [ "+green("--deep")+" ] [" + green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ]" print bold("Actions:")+" [ "+green("--clean")+" | "+green("--depclean")+" | "+green("--prune")+" | "+green("--regen")+" | "+green("--search")+" | "+green("--unmerge")+" ]" print @@ -140,8 +141,9 @@ def help(myaction,myopts,havecolor=1): print " Updates packages to the best version available, which may not" print " always be the highest version number due to masking for testing" print " and development. This will also update direct dependencies which" - print " may not what you want. In general use this option only in combi-" - print " nation with the world or system target." + print " may not what you want. Package atoms specified on the command line" + print " are greedy, meaning that unspecific atoms may match multiple" + print " installed versions of slotted packages." print print " "+green("--version")+" ("+green("-V")+" short option)" print " Displays the currently installed version of portage along with" @@ -196,11 +198,12 @@ def help(myaction,myopts,havecolor=1): print " very verbose information about the dependency and build process." print print " "+green("--deep")+" ("+green("-D")+" short option)" - print " When used in conjunction with --update, this flag forces emerge" - print " to consider the entire dependency tree of packages, instead of" - print " checking only the immediate dependencies of the packages. As an" - print " example, this catches updates in libraries that are not directly" - print " listed in the dependencies of a package." + print " This flag forces emerge to consider the entire dependency tree of" + print " packages, instead of checking only the immediate dependencies of" + print " the packages. As an example, this catches updates in libraries" + print " that are not directly listed in the dependencies of a package." + print " Also see --with-bdeps for behavior with respect to build time" + print " dependencies that are not strictly required." print print " "+green("--emptytree")+" ("+green("-e")+" short option)" print " Virtually tweaks the tree of installed packages to contain" @@ -313,6 +316,13 @@ def help(myaction,myopts,havecolor=1): print " Effects vary, but the general outcome is an increased or expanded" print " display of content in portage's displays." print + print " "+green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" >" + print " In dependency calculations, pull in build time dependencies that" + print " are not strictly required. This defaults to 'n' for installation" + print " actions and 'y' for the --depclean action. This setting can be" + print " added to EMERGE_DEFAULT_OPTS (see make.conf(5)) and later" + print " overridden via the command line." + print elif myaction == "sync": print print bold("Usage: ")+turquoise("emerge")+" "+turquoise("--sync") -- 2.26.2