diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-05-12 16:23:22 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-05-12 16:23:22 +0200 |
| commit | 6152afd41bc875529bf34367f22cf5067574d257 (patch) | |
| tree | 3ea2431739e880f4b042cf6d43e14fa8e8520848 /DistUpgrade | |
| parent | 9c767ba4bb7d2632a34e7ecbcae314ff5691f7d3 (diff) | |
| download | python-apt-6152afd41bc875529bf34367f22cf5067574d257.tar.gz | |
* tell the user about demoted packages
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/DistUpgrade.cfg | 1 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgrade.glade | 160 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 6 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 32 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeView.py | 2 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeViewGtk.py | 23 |
6 files changed, 204 insertions, 20 deletions
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 </child> </widget> +<widget class="GtkDialog" id="dialog_information"> + <property name="border_width">6</property> + <property name="title" translatable="yes"></property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">True</property> + <property name="skip_pager_hint">True</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">True</property> + <property name="has_separator">False</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="vbox15"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="hbuttonbox7"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="button12"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-close</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox16"> + <property name="border_width">6</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + + <child> + <widget class="GtkImage" id="image13"> + <property name="visible">True</property> + <property name="stock">gtk-dialog-info</property> + <property name="icon_size">6</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox16"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + + <child> + <widget class="GtkLabel" id="label_information"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">True</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scroll_information"> + <property name="width_request">400</property> + <property name="height_request">200</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTextView" id="textview_information"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="overwrite">False</property> + <property name="accepts_tab">True</property> + <property name="justification">GTK_JUSTIFY_LEFT</property> + <property name="wrap_mode">GTK_WRAP_NONE</property> + <property name="cursor_visible">True</property> + <property name="pixels_above_lines">4</property> + <property name="pixels_below_lines">4</property> + <property name="pixels_inside_wrap">0</property> + <property name="left_margin">4</property> + <property name="right_margin">4</property> + <property name="indent">0</property> + <property name="text" translatable="yes"></property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + </glade-interface> 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 = "<big><b>%s</b></big>\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): |
