diff options
| author | Sebastian Heinlein <sebi@sebi-pc> | 2006-09-29 17:59:09 +0200 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-pc> | 2006-09-29 17:59:09 +0200 |
| commit | 7afafc629b7c5b408972aafc46ef5d1887544aac (patch) | |
| tree | 05d20b738ad00a5952a60c95732b3f883731461d /DistUpgrade | |
| parent | 90a9b9f0faf09a401693f7cfcbd362ff62559929 (diff) | |
| parent | 44bb7423ea89e0174fd33108bc1112677283114e (diff) | |
| download | python-apt-7afafc629b7c5b408972aafc46ef5d1887544aac.tar.gz | |
* merge with mvo
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 18 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgrade.cfg | 5 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 36 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 23 | ||||
| -rw-r--r-- | DistUpgrade/README | 6 | ||||
| -rw-r--r-- | DistUpgrade/ReleaseAnnouncement | 2 | ||||
| -rwxr-xr-x | DistUpgrade/cdromupgrade | 4 |
7 files changed, 80 insertions, 14 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index 54d194e6..5f7ba584 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,21 @@ +2006-09-29: + - typo fix (thanks to Jane Silber) (lp: #62946) +2006-09-28: + - bugfix in the cdromupgrade script +2006-09-27: + - uploaded a version that only reverts the backport fetching + but no other changes compared to 2006-09-23 +2006-09-27: + - embarrassing bug cdromupgrade.sh +2006-09-26: + - comment out the getRequiredBackport code because we will + not use Breaks for the dapper->edgy upgrade yet + (see #54234 for the rationale) + - updated demotions.cfg for dapper->edgy + - special case the packages affected by the Breaks changes + - make sure that no translations get lost during the upgrade + (thanks to mdz for pointing this out) + - bugfixes 2006-09-23: - support fetching backports of selected packages first and use them for the upgrade (needed to support Breaks) diff --git a/DistUpgrade/DistUpgrade.cfg b/DistUpgrade/DistUpgrade.cfg index 60c3ca9f..b25def9a 100644 --- a/DistUpgrade/DistUpgrade.cfg +++ b/DistUpgrade/DistUpgrade.cfg @@ -11,6 +11,10 @@ PostUpgradePurge=xorg-common, libgl1-mesa Demotions=demoted.cfg RemoveEssentialOk=sysvinit RemovalBlacklistFile=removal_blacklist.cfg +# if those packages were installed, make sure to keep them installed +# we use this right now to emulate Breaks +KeepInstalledPkgs=gnumeric, gnumeric-gtk, hpijs +KeepInstalledSection=translations # information about the individual meta-pkgs [ubuntu-desktop] @@ -29,7 +33,6 @@ KeyDependencies=edubuntu-artwork, tuxpaint [xubuntu-desktop] KeyDependencies=xubuntu-artwork-usplash, xubuntu-default-settings, xfce4 - [Files] BackupExt=distUpgrade diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 8427bb3d..318c30cd 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -111,6 +111,39 @@ class MyCache(apt.Cache): if self.has_key(pkg): self._depcache.MarkDelete(self[pkg]._pkg,True) + def keepInstalledRule(self): + """ run after the dist-upgrade to ensure that certain + packages are kept installed """ + def keepInstalled(self, pkgname, reason): + if (self.has_key(pkgname) + and self[pkgname].isInstalled + and self[pkgname].markedDelete): + self.markInstall(pkgname, reason) + + # first the global list + for pkgname in self.config.getlist("Distro","KeepInstalledPkgs"): + keepInstalled(self, pkgname, "Distro KeepInstalledPkgs rule") + # the the per-metapkg rules + for key in self.metapkgs: + if self.has_key(key) and (self[key].isInstalled or + self[key].markedInstall): + for pkgname in self.config.getlist(key,"KeepInstalledPkgs"): + keepInstalled(self, pkgname, "%s KeepInstalledPkgs rule" % key) + # now the keepInstalledSection code + for section in self.config.getlist("Distro","KeepInstalledSection"): + for pkg in self: + if pkg.markedDelete and pkg.section == section: + keepInstalled(self, pkg.name, "Distro KeepInstalledSection rule: %s" % section) + # the the per-metapkg rules + for key in self.metapkgs: + if self.has_key(key) and (self[key].isInstalled or + self[key].markedInstall): + for section in self.config.getlist(key,"KeepInstalledSection"): + for pkg in self: + if pkg.markedDelete and pkg.section == section: + keepInstalled(self, pkg.name, "%s KeepInstalledSection rule: %s" % (key, section)) + + def postUpgradeRule(self): " run after the upgrade was done in the cache " for (rule, action) in [("Install", self.markInstall), @@ -149,6 +182,9 @@ class MyCache(apt.Cache): if not self._installMetaPkgs(view): raise SystemError, _("Can't upgrade required meta-packages") + # see if our KeepInstalled rules are honored + self.keepInstalledRule() + # and if we have some special rules self.postUpgradeRule() diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index e32c0c5f..7b255cf0 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -165,6 +165,7 @@ class DistUpgradeControler(object): # enable main (we always need this!) distro = Distribution() distro.get_sources(self.sources) + # make sure that main is enabled distro.enable_component(self.sources, "main") # this must map, i.e. second in "from" must be the second in "to" @@ -501,7 +502,7 @@ class DistUpgradeControler(object): "support for the following software " "packages. You can still get support " "from the community.\n\n" - "If you havn't enabled community " + "If you have not enabled community " "maintained software (universe), " "these packages will be suggested for " "removal in the next step."), @@ -551,9 +552,9 @@ class DistUpgradeControler(object): def abort(self): """ abort the upgrade, cleanup (as much as possible) """ - if hasattr(self, sources): + if hasattr(self, "sources"): self.sources.restoreBackup(self.sources_backup_ext) - if hasattr(self, aptcdrom): + if hasattr(self, "aptcdrom"): self.aptcdrom.restoreBackup(self.sources_backup_ext) # generate a new cache self._view.updateStatus(_("Restoring original system state")) @@ -622,14 +623,14 @@ class DistUpgradeControler(object): os.unlink(apt_pkg.Config.FindDir("Dir::Etc::sourceparts")+"/backport-source.list") apt_pkg.Config.Set("Dir::Cache::archives",cachedir) os.chdir(cwd) - return self.setupRequiredBackports(backportsdir) - - def setupRequiredBackports(self, backportsdir): - " setup the required backports in a evil way " # unpack it for deb in glob.glob(backportsdir+"/*.deb"): ret = os.system("dpkg-deb -x %s %s" % (deb, backportsdir)) # FIXME: do error checking + return self.setupRequiredBackports(backportsdir) + + def setupRequiredBackports(self, backportsdir): + " setup the required backports in a evil way " # setup some pathes to make sure the new stuff is used os.environ["LD_LIBRARY_PATH"] = backportsdir+"/usr/lib" os.environ["PYTHONPATH"] = backportsdir+"/usr/lib/python2.4/site-packages/" @@ -653,9 +654,11 @@ class DistUpgradeControler(object): if not self.prepare(): self.abort(1) - if self.options and self.options.haveBackports == False: - # get backported packages (if needed) - self.getRequiredBackports() + # mvo: commented out for now, see #54234, this needs to be + # refactored to use a arch=any tarball + #if self.options and self.options.haveBackports == False: + # # get backported packages (if needed) + # self.getRequiredBackports() # run a "apt-get update" now if not self.doUpdate(): diff --git a/DistUpgrade/README b/DistUpgrade/README index c38a422f..b9d6c5d2 100644 --- a/DistUpgrade/README +++ b/DistUpgrade/README @@ -32,6 +32,12 @@ ForcedObsoletes: happens *after* the cache.commit()) RemoveEssentialOk: Those packages are ok to remove even though they are essential +KeepInstalledPkgs: + If the package was installed before, it should still be installed + after the upgrade +KeepInstalledSection: + Packages from this section that were installed should always be + installed afterwards as well (useful for eg translations) [$meta-pkg] KeyDependencies: diff --git a/DistUpgrade/ReleaseAnnouncement b/DistUpgrade/ReleaseAnnouncement index 98eca455..6d9adb2c 100644 --- a/DistUpgrade/ReleaseAnnouncement +++ b/DistUpgrade/ReleaseAnnouncement @@ -1,7 +1,7 @@ Welcome to Ubuntu 6.10 'Edgy Eft' --------------------------------- -*WARNING: THIS IS A DEVELOPMENT SNAPSHOT* +*WARNING: THIS IS A BETA RELEASE* The Ubuntu team is proud to announce Ubuntu 6.10 'Edgy Eft'. diff --git a/DistUpgrade/cdromupgrade b/DistUpgrade/cdromupgrade index 9ed8cdea..37335045 100755 --- a/DistUpgrade/cdromupgrade +++ b/DistUpgrade/cdromupgrade @@ -23,10 +23,10 @@ if [ ! -f $fullpath/$CODENAME.tar.gz ]; then exit 1 fi -TMPDIR=$(mktemp -d distupgrade.XXXXXX) +TMPDIR=$(mktemp -d) cd $TMPDIR tar xzf $fullpath/$CODENAME.tar.gz -if [ ! -x $TMPDIR/$CODENAME ]; +if [ ! -x $TMPDIR/$CODENAME ]; then echo "Could not find the upgrade application in the archive, exiting" exit 1 fi |
