[Bug 1078544] Re: python-aptdaemon: upgrading marks auto-installed packages as manual
Brian Murray
brian at ubuntu.com
Wed Nov 14 21:48:42 UTC 2012
I tried this with 3 upgradeable packages (epiphany-browser, epiphany-
browser-data, and gdebi-core) on Quantal. Of the 3 only epiphany-
browser and epiphany-browser-data had 'Auto-Installed' changed from 1 to
0.
This was using aptdaemon version 0.45+bzr861-0ubuntu9.1.
** Also affects: aptdaemon (Ubuntu)
Importance: Undecided
Status: New
** Changed in: aptdaemon (Ubuntu)
Status: New => Triaged
** Changed in: aptdaemon (Ubuntu)
Importance: Undecided => High
--
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:
New
Status in “aptdaemon” package in Ubuntu:
Triaged
Status in “aptdaemon” package in Debian:
Unknown
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