summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DistUpgrade/Changelog3
-rw-r--r--DistUpgrade/DistUpgradeCache.py2
-rw-r--r--DistUpgrade/DistUpgradeControler.py12
-rw-r--r--SoftwareProperties/aptsources.py4
-rw-r--r--UpdateManager/UpdateManager.py2
5 files changed, 22 insertions, 1 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog
new file mode 100644
index 00000000..df5bb506
--- /dev/null
+++ b/DistUpgrade/Changelog
@@ -0,0 +1,3 @@
+2006-04-18:
+ - add logging to the sources.list modification code
+ - general logging improvements (thanks to Xavier Poinsard) \ No newline at end of file
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index 2adab2ad..ff3802fa 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -215,7 +215,7 @@ class MyCache(apt.Cache):
logging.debug("Marking '%s' for upgrade" % key)
self[key].markUpgrade()
except SystemError, e:
- logging.debug("Can't mark '%s' for upgrade" % key)
+ logging.debug("Can't mark '%s' for upgrade (%s)" % (key,e))
return False
# check if we have a meta-pkg, if not, try to guess which one to pick
if not metaPkgInstalled():
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 17ba46ee..d0fde352 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -59,6 +59,8 @@ class DistUpgradeControler(object):
def updateSourcesList(self):
+ logging.debug("updateSourcesList()")
+
# this must map, i.e. second in "from" must be the second in "to"
# (but they can be different, so in theory we could exchange
# component names here)
@@ -79,6 +81,10 @@ class DistUpgradeControler(object):
# look over the stuff we have
foundToDist = False
for entry in self.sources:
+ # ignore invalid records (but update disabled ones)
+ if entry.invalid:
+ continue
+ logging.debug("examining: '%s'" % entry)
# check if it's a mirror (or offical site)
validMirror = False
for mirror in valid_mirrors:
@@ -87,22 +93,27 @@ class DistUpgradeControler(object):
if entry.dist in toDists:
# so the self.sources.list is already set to the new
# distro
+ logging.debug("entry '%s' is already set to new dist" % entry)
foundToDist = True
elif entry.dist in fromDists:
foundToDist = True
entry.dist = toDists[fromDists.index(entry.dist)]
+ logging.debug("entry '%s' updated to new dist" % entry)
else:
# disable all entries that are official but don't
# point to the "from" dist
entry.disabled = True
+ logging.debug("entry '%s' was disabled (unknown dist)" % entry)
# it can only be one valid mirror, so we can break here
break
# disable anything that is not from a official mirror
if not validMirror:
entry.disabled = True
+ logging.debug("entry '%s' was disabled (unknown mirror)" % entry)
if not foundToDist:
# FIXME: offer to write a new self.sources.list entry
+ logging.error("No valid entry found")
return self._view.error(_("No valid entry found"),
_("While scaning your repository "
"information no valid entry for "
@@ -121,6 +132,7 @@ class DistUpgradeControler(object):
sourceslist = apt_pkg.GetPkgSourceList()
sourceslist.ReadMainList()
except SystemError:
+ logging.error("Repository information invalid after updating (we broke it!)")
self._view.error(_("Repository information invalid"),
_("Upgrading the repository information "
"resulted in a invalid file. Please "
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index a2d0a67d..417563d4 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -182,6 +182,10 @@ class SourceEntry:
if string.strip(self.line)[0] != "#":
self.line = "#" + self.line
+ def __str__(self):
+ """ debug helper """
+ return self.str().strip()
+
def str(self):
""" return the current line as string """
if self.invalid:
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 45638838..49e2ddf5 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -285,6 +285,8 @@ class UpdateManager(SimpleGladeApp):
proxy_host = cnf.Find("Synaptic::httpProxy")
proxy_port = str(cnf.FindI("Synaptic::httpProxyPort"))
if proxy_host and proxy_port:
+ # FIXME: set the proxy for libapt here as well (e.g. for the
+ # DistUpgradeFetcher
proxy_support = urllib2.ProxyHandler({"http":"http://%s:%s" % (proxy_host, proxy_port)})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)