From ec2782d7858d492f7766966aa41a3e46fb5254cb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 24 May 2011 17:45:06 -0700 Subject: [PATCH] PackageUninstall: return early if pkg is missing --- pym/_emerge/PackageUninstall.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py index 0e9130713..c846dab77 100644 --- a/pym/_emerge/PackageUninstall.py +++ b/pym/_emerge/PackageUninstall.py @@ -15,6 +15,16 @@ class PackageUninstall(CompositeTask): def _start(self): + vardb = self.pkg.root_config.trees["vartree"].dbapi + dbdir = vardb.getpath(self.pkg.cpv) + if not os.path.exists(dbdir): + # Apparently the package got uninstalled + # already, so we can safely return early. + self.returncode = os.EX_OK + self.wait() + return + + self.settings.setcpv(self.pkg) retval, pkgmap = _unmerge_display(self.pkg.root_config, self.opts, "unmerge", [self.pkg.cpv], clean_delay=0, writemsg_level=self._writemsg_level) -- 2.26.2