[Bug 1078544] Re: python-aptdaemon: upgrading marks auto-installed packages as manual

Launchpad Bug Tracker 1078544 at bugs.launchpad.net
Mon Dec 17 11:39:13 UTC 2012


This bug was fixed in the package aptdaemon - 0.45+bzr883-0ubuntu1

---------------
aptdaemon (0.45+bzr883-0ubuntu1) raring; urgency=low

  * New upstream snapshot:
    - Don't change the automatic installed state when upgrading package
      (Thanks a lot to Daniel Hartwig, LP: #1078544)
    - Add a regression test for LP: #750958
    - Don't depend on dpkg-dev to select the correct lintian profile.
      (Fixes LP: #1066457)
    -  If the user cannot be autohrized (either missing privileges
       or a cancelled password dialog) the transaction will fail.
    - Don't fail if we want to remove a a package without a
      candidate during transaction simulation.
 -- Michael Vogt <michael.vogt at ubuntu.com>   Mon, 17 Dec 2012 11:45:14 +0100

** Changed in: aptdaemon (Ubuntu Raring)
       Status: Triaged => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to aptdaemon in Ubuntu.
https://bugs.launchpad.net/bugs/1078544

Title:
  python-aptdaemon: upgrading marks auto-installed packages as manual

Status in Aptdaemon:
  Fix Committed
Status in “aptdaemon” package in Ubuntu:
  Fix Released
Status in “aptdaemon” source package in Precise:
  Triaged
Status in “aptdaemon” source package in Quantal:
  Triaged
Status in “aptdaemon” source package in Raring:
  Fix Released
Status in “aptdaemon” package in Debian:
  New

Bug description:
  [Originally reported on bugs.d.o]

  Package: python-aptdaemon
  Version: 0.45-1

  An obvious error in worker.py(_mark_packages_for_upgrade), introduced
  in revision 336[1]:

  -            auto = not self._cache._depcache.IsAutoInstalled(pkg._pkg)
  -            pkg.markInstall(False, True, auto)
  +            pkg.mark_install(False, True, pkg.is_auto_installed)

  causes previously auto-installed packages to be marked manually
  installed when upgraded with upgrade_packages or commit_packages.  The
  error is then propagated to _mark_packages_for_downgrade, introduced
  in revision 449.1.3[2].

  Python-apt has package.py(mark_upgrade) which uses “not
  pkg.is_auto_installed” as from_user, the final argument to
  mark_install.  This suggests the original code is intended.  However,
  it is noted that from_user is also influential in
  pkgDepCache::IsModeChangeOk (and others) to determine whether, e.g., a
  hold should be ignored.  It is therefore appropriate to either expose
  from_user to the calling code, or determine whether an application
  requesting specific packages to be upgraded should expect that this
  will override any holds.

  Either way, at least one of the attached patches applies.

  [1] http://bazaar.launchpad.net/~aptdaemon-developers/aptdaemon/main/revision/336
  [2] http://bazaar.launchpad.net/~aptdaemon-developers/aptdaemon/main/revision/449.1.3

  [Impact]

  Applications that use python-aptdaemon, such as software-center and
  update-manager, will trigger this bug when upgrading packages, causing
  those packages to lose their auto-installed status.  Over time, less
  and less packages will be considered for autoremoval and the system
  will become cluttered with unused old libraries and other
  dependencies.

  [Test Case, using update-manager]

  * Identify an upgradeable, auto-installed package:

  $ aptitude search -F '%p' '~U~M'
  …
  udev                                                                            
  $ PKG=udev
  $ grep-dctrl -P -X $PKG /var/lib/apt/extended_states 
  Package: udev
  Architecture: i386
  Auto-Installed: 1

  $ apt-cache policy $PKG
  udev:
    Installed: 175-3.1
    Candidate: 175-7
    Version table:
       175-7 0
          500 http://ftp.iinet.net.au/debian/debian/ sid/main i386 Packages
   *** 175-3.1 0
          100 /var/lib/dpkg/status

  * Run update-manager (which uses python-aptdaemon by default):

  $ sudo update-manager

  * Unmark all changes, then mark only the package that was identified.
  This issue may not be relevent when performing a complete upgrade.

  * Apply changes.  Quit update-manager.

  * Confirm that the package is no longer auto-installed.

  $ grep-dctrl -P -X $PKG /var/lib/apt/extended_states
  Package: udev
  Architecture: i386
  Auto-Installed: 0

  [Regression Potential]

  The code in python-aptdaemon is *obviously* wrong.  Patch is small.

To manage notifications about this bug go to:
https://bugs.launchpad.net/aptdaemon/+bug/1078544/+subscriptions




More information about the foundations-bugs mailing list