PackageUninstall: return early if pkg is missing
authorZac Medico <zmedico@gentoo.org>
Wed, 25 May 2011 00:45:06 +0000 (17:45 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 25 May 2011 00:45:06 +0000 (17:45 -0700)
pym/_emerge/PackageUninstall.py

index aebf55e9865cb3e967c97eaaf7d946ca398234bb..eb6a947a5272a1d13945a0841adf429b82e2f7c1 100644 (file)
@@ -27,9 +27,16 @@ class PackageUninstall(CompositeTask):
 
        def _start(self):
 
-               self.settings.setcpv(self.pkg)
                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)
                cat, pf = portage.catsplit(self.pkg.cpv)
                myebuildpath = os.path.join(dbdir, pf + ".ebuild")