From dc07fb27e4d9d5e8c440fcd018f05626e280e8bc Mon Sep 17 00:00:00 2001 From: David James Date: Tue, 13 Jul 2010 00:33:20 -0700 Subject: [PATCH] Teach parallel_emerge to uninstall packages. Currently, parallel_emerge doesn't know how to handle uninstall actions, so it actually installs packages when it should be uninstalling them. This patch fixes that. TEST=sudo ./parallel_emerge -uDNv hard-host-depends, and make sure it uninstalls nih-dbus-tool, which is blocked by hard-host-depends BUG=none Review URL: http://codereview.chromium.org/2990001 --- parallel_emerge | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parallel_emerge b/parallel_emerge index 60f5eba3c5..b2b61a1dbe 100755 --- a/parallel_emerge +++ b/parallel_emerge @@ -566,7 +566,7 @@ class EmergeQueue(object): len(self._jobs), len(self._retry_queue), self._total_jobs, seconds / 60, seconds % 60, self._LoadAvg()) - def _LaunchOneEmerge(self, target): + def _LaunchOneEmerge(self, target, action): """Run emerge --nodeps to do a single package install. If this is a pseudopackage, that means we're done, and can select in in the @@ -594,6 +594,8 @@ class EmergeQueue(object): newtarget = target.replace("original-", "") cmdline = (EmergeCommand() + " --nodeps --selective --noreplace " + newtarget) + elif action == "uninstall": + cmdline = EmergeCommand() + " --nodeps --unmerge =" + target else: # This package is a dependency of something we specifically # requested. Therefore we should install it but not allow it @@ -671,7 +673,7 @@ class EmergeQueue(object): else: # Kick off the build if it's marked to be built. print "Emerging %s (%s)" % (target, action) - job = self._LaunchOneEmerge(target) + job = self._LaunchOneEmerge(target, action) # Append it to the active jobs list. self._jobs.append(job) continue