Hi Michael,

> Thanks for testing [the unattended-upgrade change]! Indeed, when it
> re-evals the state it needs to update the pkgs_to_upgrade list as
> well. This is fixed in bzr now as well!

Thanks, but if you'll let me drag this bug out a little longer :-)...

There's a problem with the latest change: pkgs_to_upgrade was previously
a list of packages, not a list of pkgnames; if it contains a pkgname, an
exception is thrown when the string pkgs is built from it.  There's a
trivial patch at the end of this email to fix this.

The other thing this patch does is fix a tiny regression: previously,
pkgs_to_upgrade was automatically sorted alphabetically, because the
cache iterator happens to iterates alphabetically.  But because of the
new logic we now need something explicit.  (And the explicit sort key
seems necessary.)

Cheers,
Iain

=== modified file 'unattended-upgrade'
--- unattended-upgrade  2011-09-28 09:00:42 +0000
+++ unattended-upgrade  2011-09-29 18:24:11 +0000
@@ -588,7 +588,7 @@
                         if (cache[pkgname].marked_install or
                             cache[pkgname].marked_upgrade):
                             pkgs_kept_back.remove(pkgname)
-                            pkgs_to_upgrade.append(pkgname)
+                            pkgs_to_upgrade.append(cache[pkgname])
                 else:
                     logging.debug("sanity check failed")
                     rewind_cache(cache, pkgs_to_upgrade)
@@ -600,6 +600,7 @@
                 pkgs_kept_back.append(pkg.name)


+    pkgs_to_upgrade.sort(key=lambda p: p.name)
     pkgs = "\n".join([pkg.name for pkg in pkgs_to_upgrade])
     logging.debug("pkgs that look like they should be upgraded: %s" % pkgs)



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to