Fix interaction between automatic uninstall and options like --pretend,
authorZac Medico <zmedico@gentoo.org>
Thu, 24 Apr 2008 03:17:26 +0000 (03:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 24 Apr 2008 03:17:26 +0000 (03:17 -0000)
--fetchonly, and --buildpkgonly.

svn path=/main/trunk/; revision=9956

pym/_emerge/__init__.py

index 43f57349a0712bc460da1a2034878da86bd3a441..99e8b5a64bce711a8a2c563a7cef557d7f0ad00a 100644 (file)
@@ -4870,6 +4870,7 @@ class MergeTask(object):
        def _merge(self, mylist, favorites, mtimedb):
                from portage.elog import elog_process
                from portage.elog.filtering import filter_mergephases
+               buildpkgonly = "--buildpkgonly" in self.myopts
                failed_fetches = []
                fetchonly = "--fetchonly" in self.myopts or \
                        "--fetch-all-uri" in self.myopts
@@ -5021,7 +5022,8 @@ class MergeTask(object):
                                cpv=pkg_key, built=built, installed=installed,
                                metadata=metadata)
                        if pkg.installed:
-                               self._uninstall_queue.append(pkg)
+                               if not (buildpkgonly or fetchonly or pretend):
+                                       self._uninstall_queue.append(pkg)
                                continue
 
                        if x[0]=="blocks":