summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeCache.py29
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py4
-rw-r--r--DistUpgrade/TODO16
-rwxr-xr-xDistUpgrade/build-tarball.sh22
4 files changed, 69 insertions, 2 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index c8e1e9a1..c7cb89f3 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -107,7 +107,31 @@ class MyCache(apt.Cache):
_("A unresolvable problem occured while "
"calculating the upgrade. Please report "
"this as a bug. "))
- logging.debug("Dist-upgrade failed: '%s'", e)
+ logging.error("Dist-upgrade failed: '%s'", e)
+ return False
+
+ # check the trust of the packages that are going to change
+ untrusted = []
+ for pkg in self.getChanges():
+ if pkg.markedDelete:
+ continue
+ origins = pkg.candidateOrigin
+ trusted = False
+ for origin in origins:
+ trusted |= origin.trusted
+ if not trusted:
+ untrusted.append(pkg.name)
+ if len(untrusted) > 0:
+ untrusted.sort()
+ logging.error("Unauthenticated packages found: '%s'" % \
+ " ".join(untrusted))
+ # FIXME: maybe ask a question here? instead of failing?
+ view.error(_("Error authenticating some packages"),
+ _("It was not possible to authenticate some "
+ "packages. This may be a transient network problem. "
+ "You may want to try again later. See below for a "
+ "list of unauthenticated packages."),
+ "\n".join(untrusted))
return False
return True
@@ -119,6 +143,9 @@ class MyCache(apt.Cache):
if pkg.markedDelete and self._inRemovalBlacklist(pkg.name):
logging.debug("The package '%s' is marked for removal but it's in the removal blacklist", pkg.name)
return False
+ if pkg.markedDelete and pkg._pkg.Essential == True:
+ logging.debug("The package '%s' is marked for removal but it's a ESSENTIAL package", pkg.name)
+ return False
return True
def _installMetaPkgs(self, view):
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index bf07c2b9..71762d6e 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -35,7 +35,7 @@ import os
from apt.progress import InstallProgress
from DistUpgradeView import DistUpgradeView
-from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp
+from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp, bindtextdomain
from gettext import gettext as _
@@ -179,6 +179,8 @@ class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp):
def __init__(self):
# FIXME: i18n must be somewhere relative do this dir
+ bindtextdomain("update-manager",os.path.join(os.getcwd(),"mo"))
+
SimpleGladeApp.__init__(self, "DistUpgrade.glade",
None, domain="update-manager")
self.window_main.set_keep_above(True)
diff --git a/DistUpgrade/TODO b/DistUpgrade/TODO
index 018b356b..fa31c041 100644
--- a/DistUpgrade/TODO
+++ b/DistUpgrade/TODO
@@ -17,3 +17,19 @@ general
- check authentication and don't upgrade anything that is not
authenticated (maybe just comment unauthenticated stuff out?)
+
+
+Robustness:
+-----------
+- automatically comment out entires in the sources.list that fail to
+ fetch.
+ Trouble: apt doesn't provide a method to map from a line in th
+ sources.list to the indexFile and python-apt dosn't proivde a way to
+ get all the metaIndexes in sources.list, nor a way to get the
+ pkgIndexFiles from the metaIndexes (metaIndex is not available in
+ python-apt at all)
+ What we could do is to write DistUpgradeCache.update(), check the
+ DescURI for each failed item and guess from it what sources.list
+ line failed (e.g. uri.endswith("Sources{.bz2|.gz") -> deb-src, get
+ base-uri, find 'dists' in uri etc)
+ \ No newline at end of file
diff --git a/DistUpgrade/build-tarball.sh b/DistUpgrade/build-tarball.sh
new file mode 100755
index 00000000..57185c34
--- /dev/null
+++ b/DistUpgrade/build-tarball.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+DIST=dapper
+
+# cleanup
+rm -f *~ *.bak *.pyc
+
+# update po
+(cd ../po; make update-po)
+
+# copy the mo files
+cp -r ../po/mo .
+
+# make symlink
+if [ ! -h $DIST ]; then
+ ln -s dist-upgrade.py $DIST
+fi
+
+# create the tarbal
+tar -c -z -v --exclude=$DIST.tar.gz --exclude=$0 -f $DIST.tar.gz .
+
+