diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-13 14:19:00 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-13 14:19:00 +0100 |
| commit | 150ff5c35dd49ab503652ef295998bde9b013c60 (patch) | |
| tree | a33421c94c59b45c0a6bac14e4012c7629605b5c /DistUpgrade | |
| parent | 2d55cca343d020d2c31267396c36915ce6dc430c (diff) | |
| download | python-apt-150ff5c35dd49ab503652ef295998bde9b013c60.tar.gz | |
* check the removal_blacklist after a "normal" upgrade as well
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 20 | ||||
| -rw-r--r-- | DistUpgrade/removal_blacklist.txt | 3 |
2 files changed, 18 insertions, 5 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 diff --git a/DistUpgrade/removal_blacklist.txt b/DistUpgrade/removal_blacklist.txt index eeacd38c..7d0ee2fb 100644 --- a/DistUpgrade/removal_blacklist.txt +++ b/DistUpgrade/removal_blacklist.txt @@ -3,4 +3,5 @@ ubuntu-desktop kubuntu-destkop edubuntu-desktop ubuntu-base -linux-image-.*
\ No newline at end of file +linux-image-.* +linux-restricted-.* |
