Fix parallel_emerge --unmerge to actually work.

When we run custom actions in parallel_emerge, we should pass the list of
packages on to emerge. Otherwise emerge won't know what packages to unmerge.

Besides the above, also fix an issue where --workon doesn't override
--getbinpkgonly or --usepkgonly.

TEST=Ran parallel_emerge --unmerge dhcpd and parallel_emerge --usepkgonly --board=x86-generic
     --workon=power_manager power_manager
BUG=none

Review URL: http://codereview.chromium.org/2927013
This commit is contained in:
David James 2010-07-15 19:32:36 -07:00
parent 9f463ccf38
commit 677d9c9b6c

View File

@ -604,9 +604,11 @@ class EmergeQueue(object):
cmdline = EmergeCommand() + " --nodeps --oneshot "
this_pkg = self._deps_map[target]
if this_pkg["workon"]:
# --usepkg=n --getbinpkg=n: Build from source
# --usepkg=n --usepkgonly=n --getbinpkg=n
# --getbinpkgonly=n: Build from source
# --selective=n: Re-emerge even if package is already installed.
cmdline += "--usepkg=n --getbinpkg=n --selective=n "
cmdline += ("--usepkg=n --usepkgonly=n --getbinpkg=n "
"--getbinpkgonly=n --selective=n ")
cmdline += "=" + target
deps_info = this_pkg["deps_info"]
if deps_info["uninstall"]:
@ -753,7 +755,7 @@ OPTS, EMERGE_ACTION, EMERGE_OPTS, EMERGE_FILES = ParseArgs(sys.argv)
if EMERGE_ACTION is not None:
# Pass action arguments straight through to emerge
EMERGE_OPTS["--%s" % EMERGE_ACTION] = True
sys.exit(os.system(EmergeCommand()))
sys.exit(os.system(EmergeCommand() + " " + " ".join(EMERGE_FILES)))
elif not EMERGE_FILES:
Usage()
sys.exit(1)