On Sat, Feb 28, 2009 at 11:30:28AM +0100, Andreas Feldner wrote:
> Package: unattended-upgrades
> Version: 0.37debian1
> Severity: important
> 
> The following error report is mailed by Anacron:
> 
> /etc/cron.daily/apt:
> Traceback (most recent call last):
>  File "/usr/bin/unattended-upgrade", line 374, in <module>
>    main()
>  File "/usr/bin/unattended-upgrade", line 200, in main
>    rewind_cache(pkgs_to_upgrade)
>  File "/usr/bin/unattended-upgrade", line 112, in rewind_cache
>    cache.clear()
> NameError: global name 'cache' is not defined
 
Thanks, I fixed that in my bzr tree and it will be part of the next
upload. I also attach the fix to this mail.

Cheers,
 Michael 
=== modified file 'unattended-upgrade'
--- unattended-upgrade	2008-12-09 17:59:20 +0000
+++ unattended-upgrade	2009-03-02 09:33:52 +0000
@@ -107,7 +107,7 @@
             return False
     return True
 
-def rewind_cache(pkgs_to_upgrade):
+def rewind_cache(cache, pkgs_to_upgrade):
     " set the cache back to the state with packages_to_upgrade "
     cache.clear()
     for pkg2 in pkgs_to_upgrade:
@@ -197,12 +197,12 @@
                     pkgs_to_upgrade.append(pkg)
                 else:
                     logging.debug("sanity check failed")
-                    rewind_cache(pkgs_to_upgrade)
+                    rewind_cache(cache, pkgs_to_upgrade)
                     pkgs_kept_back.append(pkg)
             except SystemError, e:
                 # can't upgrade
                 logging.warning(_("package '%s' upgradable but fails to be marked for upgrade (%s)") % e)
-                rewind_cache(pkgs_to_ugprade)
+                rewind_cache(cache, pkgs_to_ugprade)
                 pkgs_kept_back.append(pkg)
                 
 

Reply via email to