summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-02-27 19:47:44 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-02-27 19:47:44 +0100
commit9fab3e0069ee2f9b05084787ce114a67ae65c13f (patch)
treea1d3680ffb37fac0550959de618d1640428eaf8c /DistUpgrade
parenteadf5eaff85bec1548298ce14874cac070f44454 (diff)
parent67389517a2f4c58ee03b3ba6ee540df4f8f073f7 (diff)
downloadpython-apt-9fab3e0069ee2f9b05084787ce114a67ae65c13f.tar.gz
* merged with main
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgrade.glade3
-rw-r--r--DistUpgrade/DistUpgradeView.py6
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py36
-rw-r--r--DistUpgrade/TODO18
4 files changed, 44 insertions, 19 deletions
diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade
index c28b20ad..e50476e2 100644
--- a/DistUpgrade/DistUpgrade.glade
+++ b/DistUpgrade/DistUpgrade.glade
@@ -586,12 +586,13 @@
<child>
<widget class="GtkLabel" id="label_summary">
<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">False</property>
+ <property name="selectable">True</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py
index 4c9103ba..8e9a3d3f 100644
--- a/DistUpgrade/DistUpgradeView.py
+++ b/DistUpgrade/DistUpgradeView.py
@@ -65,9 +65,9 @@ class DistUpgradeView(object):
def confirmRestart(self):
" generic ask about the restart, can be overriden "
summary = _("Reboot required")
- msg = _("The upgrade is finished now. "
- "A reboot is required to "
- "now, do you want to do this "
+ msg = _("The upgrade is finished and "
+ "a reboot is required. "
+ "Do you want to do this "
"now?")
return self.askYesNoQuestion(summary, msg)
def error(self, summary, msg, extended_msg=None):
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index 3697a49e..2f7e3fed 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -126,6 +126,7 @@ class GtkInstallProgressAdapter(InstallProgress):
reaper.connect("child-exited", self.child_exited)
# some options for dpkg to make it die less easily
apt_pkg.Config.Set("DPkg::Options::","--force-overwrite")
+
def startUpdate(self):
self.finished = False
# FIXME: add support for the timeout
@@ -161,15 +162,19 @@ class GtkInstallProgressAdapter(InstallProgress):
def fork(self):
pid = self.term.forkpty(envv=self.env)
return pid
+
def child_exited(self, term, pid, status):
self.apt_status = os.WEXITSTATUS(status)
self.finished = True
+
def waitChild(self):
while not self.finished:
self.updateInterface()
return self.apt_status
+
def finishUpdate(self):
self.label_status.set_text("")
+
def updateInterface(self):
InstallProgress.updateInterface(self)
self.progress.set_fraction(self.percent/100.0)
@@ -181,9 +186,6 @@ class GtkInstallProgressAdapter(InstallProgress):
class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
" gtk frontend of the distUpgrade tool "
-
-
-
def __init__(self):
# FIXME: i18n must be somewhere relative do this dir
bindtextdomain("update-manager",os.path.join(os.getcwd(),"mo"))
@@ -228,6 +230,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
"files ~/dist-upgrade.log and ~/dist-upgrade-apt.log "
"in your report. The upgrade aborts now. "),
"\n".join(lines))
+ sys.exit(1)
def create_terminal(self, arg1,arg2,arg3,arg4):
" helper to create a vte terminal "
@@ -237,6 +240,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
self._terminal_lines = []
self._terminal_log = open("/var/log/dist-upgrade-term.log","w")
return self._term
+
def _term_content_changed(self, term):
" called when the *visible* part of the terminal changes "
@@ -277,7 +281,6 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
attrlist.insert(attr)
label.set_property("attributes",attrlist)
-
def error(self, summary, msg, extended_msg=None):
self.dialog_error.set_transient_for(self.window_main)
#self.expander_terminal.set_expanded(True)
@@ -309,30 +312,41 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
pkgs_remove,
"%s packages are going to be removed." %\
pkgs_remove, pkgs_remove)
- msg +=" "
+ msg += " "
if pkgs_inst > 0:
msg += gettext.ngettext("%s new package is going to be "\
"installed." % pkgs_inst,
"%s new packages are going to be "\
"installed." % pkgs_inst, pkgs_inst)
- msg +=" "
+ msg += " "
if pkgs_upgrade > 0:
msg += gettext.ngettext("%s package is going to be upgraded." %\
pkgs_upgrade,
"%s packages are going to be upgraded." %\
pkgs_upgrade, pkgs_upgrade)
msg +=" "
- if msg == "":
+
+ if downloadSize > 0:
+ msg += _("You have to download a total of %s." %\
+ apt_pkg.SizeToStr(downloadSize))
+
+ if (pkgs_upgrade + pkgs_inst + pkgs_remove) > 100:
+ msg += "\n\n%s" % _("The upgrade can take several hours and "\
+ "cannot be canceled at any time later.")
+
+ msg += "\n\n<b>%s</b>" % _("To prevent data loss close all open "\
+ "applications and documents.")
+
+ # Show an error if no actions are planned
+ if (pkgs_upgrade + pkgs_inst + pkgs_remove) < 1:
# FIXME: this should go into DistUpgradeController
summary = _("Could not find any upgrades")
msg = _("Your system has already been upgraded.")
self.error(summary, msg)
return False
- else:
- msg += _("You have to download a total of %s." %\
- apt_pkg.SizeToStr(downloadSize))
+
self.label_summary.set_markup("<big><b>%s</b></big>" % summary)
- self.label_changes.set_text(msg)
+ self.label_changes.set_markup(msg)
# fill in the details
self.details_list.clear()
for rm in self.toRemove:
diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO
index df64b54b..fb6895f9 100644
--- a/DistUpgrade/TODO
+++ b/DistUpgrade/TODO
@@ -1,3 +1,17 @@
+MUSTFIX:
+--------
+* debconf gnome dosn't work (can't connect to the session)
+* display a message that all applications should be closed for the
+ dist-upgrade (and that strange things like a crashing panel can
+ happen)
+
+
+
+breezy->dapper
+--------------
+- gnome-icon-theme changes a lot, icons move from hicolor to gnome.
+ this might have caused a specatular crash during a upgrade
+
hoary->breezy
-------------
@@ -13,12 +27,8 @@ breezy->dapper
general
-------
- CDROM upgrades !!!
-- display a message that all applications should be closed for the
- dist-upgrade (and that strange things like a crashing panel can
- happen)
- whitelist removal (pattern? e.g. c102 -> c2a etc)?
-- logging for the dpkg install run
- check authentication and don't upgrade anything that is not
authenticated (maybe just comment unauthenticated stuff out?)