From 6152afd41bc875529bf34367f22cf5067574d257 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 12 May 2006 16:23:22 +0200 Subject: * tell the user about demoted packages --- DistUpgrade/DistUpgrade.cfg | 1 + DistUpgrade/DistUpgrade.glade | 160 ++++++++++++++++++++++++++++++++++++ DistUpgrade/DistUpgradeCache.py | 6 -- DistUpgrade/DistUpgradeControler.py | 32 +++++++- DistUpgrade/DistUpgradeView.py | 2 +- DistUpgrade/DistUpgradeViewGtk.py | 23 ++++-- 6 files changed, 204 insertions(+), 20 deletions(-) (limited to 'DistUpgrade') diff --git a/DistUpgrade/DistUpgrade.cfg b/DistUpgrade/DistUpgrade.cfg index de52098d..c594f296 100644 --- a/DistUpgrade/DistUpgrade.cfg +++ b/DistUpgrade/DistUpgrade.cfg @@ -8,6 +8,7 @@ View=DistUpgradeViewGtk MetaPkgs=ubuntu-desktop, kubuntu-desktop, edubuntu-desktop, xubuntu-desktop BaseMetaPkgs=ubuntu-base PostUpgradePurge=xorg-common +Demotions=demoted.cfg # information about the individual meta-pkgs [ubuntu-desktop] diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index f6a8041d..e398bfdb 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -1783,4 +1783,164 @@ The system could be in an unusable state if you cancel the upgrade. You are stro + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-info + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 + + + + True + True + + False + True + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + 400 + 200 + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 4 + 4 + 0 + 4 + 4 + 0 + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index c46a0e69..96b8517d 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -17,12 +17,6 @@ class MyCache(apt.Cache): self.config = DistUpgradeConfig() self.metapkgs = self.config.getlist("Distro","MetaPkgs") - # turn on debuging - apt_pkg.Config.Set("Debug::pkgProblemResolver","true") - fd = os.open("/var/log/dist-upgrade-apt.log", os.O_RDWR|os.O_CREAT|os.O_TRUNC) - os.dup2(fd,1) - os.dup2(fd,2) - # a list of regexp that are not allowed to be removed self.removal_blacklist = [] for line in open("removal_blacklist.txt").readlines(): diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 2b5275f4..059e577f 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -53,6 +53,13 @@ class DistUpgradeControler(object): # forced obsoletes self.forced_obsoletes = self.config.getlist("Distro","ForcedObsoletes") + # turn on debuging in the cache + apt_pkg.Config.Set("Debug::pkgProblemResolver","true") + fd = os.open("/var/log/dist-upgrade-apt.log", + os.O_RDWR|os.O_CREAT|os.O_TRUNC) + os.dup2(fd,1) + os.dup2(fd,2) + def openCache(self): self.cache = MyCache(self._view.getOpCacheProgress()) @@ -356,7 +363,24 @@ class DistUpgradeControler(object): self.forced_obsoletes.extend(self.config.getlist(pkg,"ForcedObsoletes")) logging.debug("forced_obsoletes: %s", self.forced_obsoletes) - + # check what packages got demoted + demotions_file = self.config.get("Distro","Demotions") + demotions = set() + if os.path.exists(demotions_file): + map(lambda pkgname: demotions.add(pkgname.strip()), + filter(lambda line: not line.startswith("#"), + open(demotions_file).readlines())) + installed_demotions = filter(lambda pkg: pkg.isInstalled and pkg.name in demotions, self.cache) + if len(installed_demotions) > 0: + self._view.information(_("Some software no longer supported"), + _("Some of your installed packages are " + "no longer officially supported. See " + "below for a list of installed packages " + "that moved from the 'officially " + "supported' area (main) to the " + "'community supported' area " + "(universe). "), + "\n".join([pkg.name for pkg in installed_demotions])) # mark packages that are now obsolete (and where not obsolete # before) to be deleted. make sure to not delete any foreign @@ -454,9 +478,9 @@ class DistUpgradeControler(object): self.abort() self._view.updateStatus(_("Upgrading")) - if not self.doDistUpgrade(): - # don't abort here, because it would restore the sources.list - sys.exit(1) +# if not self.doDistUpgrade(): +# # don't abort here, because it would restore the sources.list +# sys.exit(1) # do post-upgrade stuff self._view.setStep(4) diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py index 99dedc6f..faa581c8 100644 --- a/DistUpgrade/DistUpgradeView.py +++ b/DistUpgrade/DistUpgradeView.py @@ -81,6 +81,6 @@ class DistUpgradeView(object): def error(self, summary, msg, extended_msg=None): " display a error " pass - def information(self, summary, msg): + def information(self, summary, msg, extended_msg=None): " display a information msg" pass diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 80575859..6454bbe3 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -378,15 +378,20 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): attrlist.insert(attr) label.set_property("attributes",attrlist) - def information(self, summary, msg): + def information(self, summary, msg, extended_msg=None): + self.dialog_information.set_transient_for(self.window_main) msg = "%s\n\n%s" % (summary,msg) - dialog = gtk.MessageDialog(parent=self.window_main, - flags=gtk.DIALOG_MODAL, - type=gtk.MESSAGE_INFO, - buttons=gtk.BUTTONS_CLOSE) - dialog.set_markup(msg) - dialog.run() - dialog.destroy() + self.label_information.set_markup(msg) + if extended_msg != None: + buffer = self.textview_information.get_buffer() + buffer.set_text(extended_msg) + self.scroll_information.show() + else: + self.scroll_information.hide() + self.dialog_information.realize() + self.dialog_information.window.set_functions(gtk.gdk.FUNC_MOVE) + self.dialog_information.run() + self.dialog_information.hide() def error(self, summary, msg, extended_msg=None): self.dialog_error.set_transient_for(self.window_main) @@ -402,7 +407,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): self.dialog_error.realize() self.dialog_error.window.set_functions(gtk.gdk.FUNC_MOVE) self.dialog_error.run() - self.dialog_error.destroy() + self.dialog_error.hide() return False def confirmChanges(self, summary, changes, downloadSize, actions=None): -- cgit v1.2.3