ansible/library/packaging
martin f. krafft 420f7d7ac6 Introduce non-purged package status
A package may be removed but not purged with APT. The only way to
identify this state is by looking at the list of installed files of
a package. Even if the package has no files installed, this list will be
non-empty until the package is removed:

  # python -c "import apt; c=apt.Cache(); c.update(); c.open(); p=c['ruby1.8']; print p, p.installed, p.installed_files"
  <Package: name:'ruby1.8' id:1425> None [u'']

  # dpkg --purge ruby1.8
  (Reading database ... 27904 files and directories currently installed.)
  Removing ruby1.8 ...
  Purging configuration files for ruby1.8 ...

  # python -c "import apt; c=apt.Cache(); c.update(); c.open(); p=c['ruby1.8']; print p, p.installed, p.installed_files"
  <Package: name:'ruby1.8' id:1425> None []

See http://bugs.debian.org/712749 too.

If a package is not marked installed but it still 'has_files', then it
should be processed if the request is to purge it.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2013-06-19 10:00:33 +02:00
..
apt Introduce non-purged package status 2013-06-19 10:00:33 +02:00
apt_key Merge conflict 2013-06-18 20:18:17 -04:00
apt_repository DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
easy_install DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
gem Docs: consistently format playbook EXAMPLES 2013-06-17 08:53:46 +02:00
homebrew Docs: consistently format playbook EXAMPLES 2013-06-17 08:53:46 +02:00
macports DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
npm Merge pull request #3199 from chrishoffman/doc_error 2013-06-16 19:28:12 -07:00
openbsd_pkg Merge pull request #3225 from eest/openbsd_pkg-check_mode 2013-06-16 19:40:46 -07:00
opkg DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
pacman DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
pip DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
pkgin DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
pkgng Merge pull request #3227 from bcoca/modules_wantlist 2013-06-16 19:29:02 -07:00
redhat_subscription DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
rhn_channel DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
rhn_register Docs: consistently format playbook EXAMPLES 2013-06-17 08:53:46 +02:00
svr4pkg DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
yum Merge pull request #3227 from bcoca/modules_wantlist 2013-06-16 19:29:02 -07:00
zypper DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00