summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/main.py
diff options
context:
space:
mode:
authorDavid James <davidjames@google.com>2011-05-01 10:21:45 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-01 10:21:45 -0700
commit470871eeafa89a05486d4eb6f3f7626c1f813e4d (patch)
treeaeb8eb32a862b2a0e271755372ba4c9994b50800 /pym/_emerge/main.py
parentdf15d8c67d6c9d821a5fada0063c04da9bb2bed6 (diff)
downloadportage-470871eeafa89a05486d4eb6f3f7626c1f813e4d.tar.gz
portage-470871eeafa89a05486d4eb6f3f7626c1f813e4d.tar.bz2
portage-470871eeafa89a05486d4eb6f3f7626c1f813e4d.zip
emerge: add --rebuild and --norebuild-atoms opts
Rebuild when build-time/run-time deps are upgraded. If pkgA has been updated, and pkgB depends on pkgA at both build-time and run-time, pkgB needs to be rebuilt. This feature ensures that all packages are consistent when dependencies that are used at both runtime and build time are changed. This feature only rebuilds packages one layer deep. That means that if you upgrade libcros, for example, packages that depend directly on libcros will be rebuilt and reinstalled, but indirect dependencies will not be rebuilt. BUG=chromium-os:14296 TEST=Test whether packages rebuilding a bunch of packages. Change-Id: Idbc0532b4b1de28fd9e5a0abe3b7dbe1a3abd2c8 Review URL: http://codereview.chromium.org/6905107
Diffstat (limited to 'pym/_emerge/main.py')
-rw-r--r--pym/_emerge/main.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index e0cd0c024..434fd5a57 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -440,6 +440,7 @@ def insert_optional_args(args):
'--package-moves' : y_or_n,
'--quiet' : y_or_n,
'--quiet-build' : y_or_n,
+ '--rebuild' : y_or_n,
'--rebuilt-binaries' : y_or_n,
'--root-deps' : ('rdeps',),
'--select' : y_or_n,
@@ -741,6 +742,14 @@ def parse_opts(tmpcmdline, silent=False):
"action" : "append",
},
+ "--norebuild-atoms": {
+ "help" :"A space separated list of package names or slot atoms. " + \
+ "Emerge will not rebuild these packages due to the " + \
+ "--rebuild flag. ",
+
+ "action" : "append",
+ },
+
"--package-moves": {
"help" : "perform package moves when necessary",
"type" : "choice",
@@ -760,6 +769,13 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : true_y_or_n
},
+ "--rebuild": {
+ "help" : "Rebuild packages when dependencies that are " + \
+ "used at both build-time and run-time are upgraded.",
+ "type" : "choice",
+ "choices" : true_y_or_n
+ },
+
"--rebuilt-binaries": {
"help" : "replace installed packages with binary " + \
"packages that have been rebuilt",
@@ -889,7 +905,7 @@ def parse_opts(tmpcmdline, silent=False):
else:
myoptions.binpkg_respect_use = None
- if myoptions.complete_graph in true_y:
+ if myoptions.complete_graph in true_y or myoptions.rebuild in true_y:
myoptions.complete_graph = True
else:
myoptions.complete_graph = None
@@ -910,6 +926,12 @@ def parse_opts(tmpcmdline, silent=False):
parser.error("Invalid Atom(s) in --reinstall-atoms parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
(",".join(bad_atoms),))
+ if myoptions.norebuild_atoms:
+ bad_atoms = _find_bad_atoms(myoptions.norebuild_atoms)
+ if bad_atoms and not silent:
+ parser.error("Invalid Atom(s) in --norebuild-atoms parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
+ (",".join(bad_atoms),))
+
if myoptions.nousepkg_atoms:
bad_atoms = _find_bad_atoms(myoptions.nousepkg_atoms)
if bad_atoms and not silent:
@@ -953,6 +975,11 @@ def parse_opts(tmpcmdline, silent=False):
else:
myoptions.quiet_build = None
+ if myoptions.rebuild in true_y:
+ myoptions.rebuild = True
+ else:
+ myoptions.rebuild = None
+
if myoptions.rebuilt_binaries in true_y:
myoptions.rebuilt_binaries = True