diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-09 11:21:46 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-09 11:21:46 +0100 |
| commit | 2deb9251afd7896a3206a94a0fba393657a85891 (patch) | |
| tree | e4b94bd862080348c61826a54e067a4ea5ee727f | |
| parent | 1efb4bfec356efef45a7821a6934e6925a922a80 (diff) | |
| download | python-apt-2deb9251afd7896a3206a94a0fba393657a85891.tar.gz | |
* add self.missingPkgs to have a generic list of stuff that needs to be installed
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 91624f86..8e588132 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -67,11 +67,16 @@ class DistUpgradeControler(object): self._view = distUpgradeView self._view.updateStatus(_("Reading cache")) self.cache = None + # some constants here self.fromDist = "hoary" self.toDist = "breezy" self.origin = "Ubuntu" + # a list of missing pkg names in the current install that neesd to + # be added before the dist-upgrade (e.g. missing ubuntu-desktop) + self.missingPkgs = [] + def openCache(self): self.cache = MyCache(self._view.getOpCacheProgress()) @@ -110,8 +115,12 @@ class DistUpgradeControler(object): deps_found |= self.cache[pkg].isInstalled if deps_found: print "guessing '%s' as missing meta-pkg" % key - self.cache[key].markInstall() - break + try: + self.cache[key].markInstall() + self.missingPkgs.append(key) + break + except SystemError: + pass # check if we actually found one if not metaPkgInstalled(): # FIXME: provide a list @@ -244,8 +253,9 @@ class DistUpgradeControler(object): self.cache.update(progress) def askDistUpgrade(self): - # FIXME: add "ubuntu-desktop" (or kubuntu-desktop, edubuntu-desktop) - # (if required) + # add missing pkgs (like {ubuntu,kubuntu,edubuntu}-desktop) + for pkg in self.missingPkgs: + self.cache[pkg].markInstall() self.cache.upgrade(True) changes = self.cache.getChanges() res = self._view.confirmChanges(changes,self.cache.requiredDownload) |
