summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <egon@top>2005-12-06 19:12:50 +0100
committerMichael Vogt <egon@top>2005-12-06 19:12:50 +0100
commit655e994c327220013e90eafa348ceaf22090f315 (patch)
tree68de478ca2739b4f9fc17b81a70d984eb31dc81e /DistUpgrade
parent0fe72e8bb3cd2fe424fdfaddabde7ed395252b36 (diff)
downloadpython-apt-655e994c327220013e90eafa348ceaf22090f315.tar.gz
* DistUpgrade/DistUpgrade.py:
- compile a list of foreign and obsolete pkgs * updated TODO and breezy-rm.whitelist
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgrade.py58
-rw-r--r--DistUpgrade/TODO10
-rw-r--r--DistUpgrade/data/breezy-rm.whitelist5
3 files changed, 58 insertions, 15 deletions
diff --git a/DistUpgrade/DistUpgrade.py b/DistUpgrade/DistUpgrade.py
index 968e43b7..ffd49772 100644
--- a/DistUpgrade/DistUpgrade.py
+++ b/DistUpgrade/DistUpgrade.py
@@ -10,6 +10,7 @@ import gobject
import apt
import apt_pkg
import sys
+import subprocess
from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp
from UpdateManager.GtkProgress import GtkOpProgress
@@ -23,6 +24,15 @@ class MyCache(apt.Cache):
fetcher = apt_pkg.GetAcquire()
pm.GetArchives(fetcher, self._list, self._records)
return fetcher.FetchNeeded
+ def downloadable(self, pkg, useCandidate=True):
+ " check if the given pkg can be downloaded "
+ if useCandidate:
+ ver = self._depcache.GetCandidateVer(pkg._pkg)
+ else:
+ ver = pkg._pkg.CurrentVer
+ if ver == None:
+ return False
+ return ver.Downloadable
@@ -172,6 +182,10 @@ class DistUpgradeControler(object):
self._view = distUpgradeView
self._view.updateStatus(_("Reading cache"))
self._cache = MyCache(self._view.getOpCacheProgress())
+ # some constants here
+ self.fromDist = "hoary"
+ self.toDist = "breezy"
+ self.origin = "Ubuntu"
def sanityCheck(self):
if self._cache._depcache.BrokenCount > 0:
@@ -185,21 +199,21 @@ class DistUpgradeControler(object):
# FIXME: check for ubuntu-desktop, kubuntu-dekstop, edubuntu-desktop
return True
- def updateSourcesList(self, fromDist, to):
+ def updateSourcesList(self):
sources = SourcesList()
# this must map, i.e. second in "from" must be the second in "to"
# (but they can be different, so in theory we could exchange
# component names here)
- fromDists = [fromDist,
- fromDist+"-security",
- fromDist+"-updates",
- fromDist+"-backports"
+ fromDists = [self.fromDist,
+ self.fromDist+"-security",
+ self.fromDist+"-updates",
+ self.fromDist+"-backports"
]
- toDists = [to,
- to+"-security",
- to+"-updates",
- to+"-backports"
+ toDists = [self.toDist,
+ self.toDist+"-security",
+ self.toDist+"-updates",
+ self.toDist+"-backports"
]
# list of valid mirrors that we can add
@@ -227,7 +241,7 @@ class DistUpgradeControler(object):
break
else:
# disable non-official entries that point to dist
- if entry.dist == fromDist:
+ if entry.dist == self.fromDist:
entry.disabled = True
if not foundToDist:
@@ -259,7 +273,21 @@ class DistUpgradeControler(object):
def doPreUpgrade(self):
# FIXME: check out what packages are downloadable etc to
# compare the list after the update again
- pass
+ self.foreign_pkgs = set()
+ self.obsolete_pkgs =set()
+ for pkg in self._cache:
+ if pkg.isInstalled:
+ if not self._cache.downloadable(pkg, useCandidate=False):
+ self.obsolete_pkgs.add(pkg.name)
+ continue
+ origin = pkg.candidateOrigin
+ if origin.archive != self.fromDist or \
+ origin.archive != self.toDist or \
+ origin.origin != self.origin:
+ self.foreign_pkgs.add(pkg.name)
+ print self.foreign_pkgs
+ print self.obsolete_pkgs
+
def doUpdate(self):
self._cache._list.ReadMainList()
@@ -295,9 +323,12 @@ class DistUpgradeControler(object):
if not self.sanityCheck():
sys.exit(1)
+ # do pre-upgrade stuff (calc list of obsolete pkgs etc)
+ self.doPreUpgrade()
+
# update sources.list
self._view.updateStatus(_("Updating repository information"))
- if not self.updateSourcesList(fromDist="hoary",to="breezy"):
+ if not self.updateSourcesList():
sys.exit(1)
# then update the package index files
self.doUpdate()
@@ -306,9 +337,6 @@ class DistUpgradeControler(object):
self._view.updateStatus(_("Reading cache"))
self._cache = MyCache(self._view.getOpCacheProgress())
- # do pre-upgrade stuff
- self.doPreUpgrade()
-
# calc the dist-upgrade and see if the removals are ok/expected
# do the dist-upgrade
if not self.askDistUpgrade():
diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO
new file mode 100644
index 00000000..0c6ee909
--- /dev/null
+++ b/DistUpgrade/TODO
@@ -0,0 +1,10 @@
+- display a message that all applications should be closed for the
+ dist-upgrade (and that strange things like a crashing panel can
+ happen)
+- stop gnome-volume-manager before the hoary->breezy upgrade
+ (it will crash otherwise)
+- DistUpgradeControler.sanityCheck:
+ * fix borken caches
+ * check for ubuntu desktop etc
+- check authentication and don't upgrade anything that is not
+ authenticated (maybe just comment unauthenticated stuff out?)
diff --git a/DistUpgrade/data/breezy-rm.whitelist b/DistUpgrade/data/breezy-rm.whitelist
index cd5d6d0b..bd7fbbc7 100644
--- a/DistUpgrade/data/breezy-rm.whitelist
+++ b/DistUpgrade/data/breezy-rm.whitelist
@@ -7,17 +7,22 @@ dbus-glib-1 # " by libdbus-glib-1-1
libcamel1.2-3 # " by libcamel1.2-6
libebook1.2-3 # " by libebook1.2-5
libedataserverui1.2-4 # " by libedataserverui1.2-6
+libesd0 # " by libesd-alsa0
libgc1 # " by libgc1c2
libhal-storage0 # " by libhal-storage1
libhal0 # " by libhal1
libid3-3.8.3 # " by libid3-3.8.3c2
libmusicbrainz2 # " by libmusicbrainz2c2
libmusicbrainz4 # " by libmusicbrainz4c2
+libmyspell3 # " by libmyspell3c2
libnautilus-burn1 # " by libnautilus-burn2
+libopenh323-1.15.2 # " by libopenh323-1.15.2c2
libostyle1 # " by libostyle1c2
libpt-1.8.3 # " by libpt-1.8.3c2
libsmpeg0 # " by libsmpeg0c2
+libstlport4.6 # " by libstlport4.6c2
libsp1 # " by libsp1c2
+openoffice.org-thesaurus-en-us # conflicts with openoofice.org2-core
postfix-tls # postfix provides this now
ubuntu-quickguide # not updated to breezy
xlibmesa-dri # replaced by libgl1-mesa-dri