Package: unattended-upgrades
Version: 0.80~exp2
Severity: normal
Tags: patch

When combining the new --verbose option (or the already existing --debug) in
experimental with --dry-run you get one (actually two) backtraces. 

root@lxbsc02:~# LANG=C unattended-upgrade --dry-run --verbose
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=Debian,a=testing', 
'origin=Debian,archive=stable,label=Debian-Security']
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: chromium chromium-inspector chromium-l10n
Writing dpkg log to 
'/var/log/unattended-upgrades/unattended-upgrades-dpkg_2013-04-17_15:53:19.142905.log'
Exception: [Errno 2] No such file or directory: 
'/var/log/unattended-upgrades/unattended-upgrades-dpkg_2013-04-17_15:53:19.142905.log'Traceback
 (most recent call last):
  File "/usr/bin/unattended-upgrade", line 1039, in <module>
    main(options)
  File "/usr/bin/unattended-upgrade", line 992, in main
    cache, pkgs_to_upgrade, options, logfile_dpkg)
  File "/usr/bin/unattended-upgrade", line 701, in do_install
    return pkg_install_success
UnboundLocalError: local variable 'pkg_install_success' referenced before 
assignment
root@lxbsc02:~# Reading changelogs...
/usr/bin/dpkg --status-fd 7 --unpack --auto-deconfigure 
/var/cache/apt/archives/chromium-l10n_26.0.1410.43-1_all.deb 
/var/cache/apt/archives/chromium_26.0.1410.43-1_amd64.deb 
/var/cache/apt/archives/chromium-inspector_26.0.1410.43-1_all.deb
/usr/bin/dpkg --status-fd 9 --configure chromium-inspector:all chromium:amd64 
chromium-l10n:all

The uninitialized variable is already known and easily fixed by
http://bazaar.launchpad.net/~unattended-upgrades-developers/unattended-upgrades/trunk/revision/267

However, the other error still exists and creates weird issues, like
continuing output while unattended-upgrades has already exited.

root@lxbsc02:~# LANG=C unattended-upgrade --dry-run --verbose ; echo 
unattended-upgrade has finished
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=Debian,a=testing', 
'origin=Debian,archive=stable,label=Debian-Security']
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: chromium chromium-inspector chromium-l10n
Writing dpkg log to 
'/var/log/unattended-upgrades/unattended-upgrades-dpkg_2013-04-17_16:02:35.391469.log'
Exception: [Errno 2] No such file or directory: 
'/var/log/unattended-upgrades/unattended-upgrades-dpkg_2013-04-17_16:02:35.391469.log'Reading
 changelogs...
unattended-upgrade has finished
root@lxbsc02:~# /usr/bin/dpkg --status-fd 7 --unpack --auto-deconfigure 
/var/cache/apt/archives/chromium-l10n_26.0.1410.43-1_all.deb 
/var/cache/apt/archives/chromium_26.0.1410.43-1_amd64.deb 
/var/cache/apt/archives/chromium-inspector_26.0.1410.43-1_all.deb
/usr/bin/dpkg --status-fd 9 --configure chromium-inspector:all chromium:amd64 
chromium-l10n:all

I _think_ it is fixed by the attached patch, but I'm not really familiar with
the code.

root@lxbsc02:~# LANG=C unattended-upgrade --dry-run --verbose ; echo 
unattended-upgrade has finished
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=Debian,a=testing', 
'origin=Debian,archive=stable,label=Debian-Security']
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: chromium chromium-inspector chromium-l10n
Writing dpkg log to 
'/var/log/unattended-upgrades/unattended-upgrades-dpkg_2013-04-17_16:04:04.756226.log'
Reading changelogs...
/usr/bin/dpkg --status-fd 7 --unpack --auto-deconfigure 
/var/cache/apt/archives/chromium-l10n_26.0.1410.43-1_all.deb 
/var/cache/apt/archives/chromium_26.0.1410.43-1_amd64.deb 
/var/cache/apt/archives/chromium-inspector_26.0.1410.43-1_all.deb
/usr/bin/dpkg --status-fd 9 --configure chromium-inspector:all chromium:amd64 
chromium-l10n:all
All upgrades installed
unattended-upgrade has finished

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages unattended-upgrades depends on:
ii  apt                    0.9.7.8
ii  apt-utils              0.9.7.8
ii  debconf [debconf-2.0]  1.5.49
ii  lsb-base               4.1+Debian8
ii  lsb-release            4.1+Debian8
ii  python                 2.7.3-4
ii  python-apt             0.8.9~exp2
ii  ucf                    3.0025+nmu3
ii  xz-utils               5.1.1alpha+20120614-2

unattended-upgrades recommends no packages.

Versions of packages unattended-upgrades suggests:
ii  bsd-mailx                       8.1.2-0.20111106cvs-1
ii  postfix [mail-transport-agent]  2.9.6-2

-- Configuration Files:
/etc/apt/apt.conf.d/50unattended-upgrades changed [not included]

-- debconf information excluded
--- /usr/bin/unattended-upgrade	2013-03-14 09:19:39.000000000 +0100
+++ unattended-upgrade	2013-04-17 16:05:37.730438135 +0200
@@ -171,7 +171,7 @@
         # call super class first
         apt.progress.base.InstallProgress.update_interface(self)
         # and now we do too
-        if self.verbose:
+        if self.verbose and not apt_pkg.config.find_b("Debug::pkgDPkgPM", False):
             if self.output_logfd is None:
                 self.output_logfd = os.open(self.logfile_dpkg, os.O_RDONLY)
             try:
@@ -678,6 +678,8 @@
 
     logging.info(_("Writing dpkg log to '%s'") % logfile_dpkg)
 
+    pkg_install_success = False
+
     try:
         if (options.minimal_upgrade_steps or 
             # COMPAT with the mispelling

Reply via email to