summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeControler.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-01-13 14:19:00 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-01-13 14:19:00 +0100
commit150ff5c35dd49ab503652ef295998bde9b013c60 (patch)
treea33421c94c59b45c0a6bac14e4012c7629605b5c /DistUpgrade/DistUpgradeControler.py
parent2d55cca343d020d2c31267396c36915ce6dc430c (diff)
downloadpython-apt-150ff5c35dd49ab503652ef295998bde9b013c60.tar.gz
* check the removal_blacklist after a "normal" upgrade as well
Diffstat (limited to 'DistUpgrade/DistUpgradeControler.py')
-rw-r--r--DistUpgrade/DistUpgradeControler.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 5572ac99..9519cabf 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -98,10 +98,10 @@ class DistUpgradeControler(object):
self.cache = None
# some constants here
- self.fromDist = "hoary"
- self.toDist = "breezy"
- #self.fromDist = "breezy"
- #self.toDist = "dapper"
+ #self.fromDist = "hoary"
+ #self.toDist = "breezy"
+ self.fromDist = "breezy"
+ self.toDist = "dapper"
self.origin = "Ubuntu"
@@ -323,6 +323,8 @@ class DistUpgradeControler(object):
for pkg in self.missing_pkgs:
logging.debug("Installing missing pkg: %s" % pkg)
self.cache[pkg].markInstall()
+ if not self._verifyChanges():
+ raise SystemError, _("A essential package would have to be removed")
except SystemError, e:
# FIXME: change the text to something more useful
self._view.error(_("Could not calculate the upgrade"),
@@ -389,6 +391,16 @@ class DistUpgradeControler(object):
return True
return False
+ def _verifyChanges(self):
+ """ this function tests if the current changes don't violate
+ our constrains (blacklisted removals etc)
+ """
+ for pkg in self.cache.getChanges():
+ if pkg.markedDelete and self._inRemovalBlacklist(pkg.name):
+ logging.debug("The package '%s' is marked for removal but it's in the removal blacklist")
+ return False
+ return True
+
def _tryMarkObsoleteForRemoval(self, pkgname, remove_candidates):
# this is a delete candidate, only actually delete,
# if it dosn't remove other packages depending on it