Fix purging of packages

A small error in the reuse of a variable caused packages to never get
purged. This commit fixes that.

Signed-off-by: martin f. krafft <madduck@madduck.net>
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>
Always assume purged for older python-apt

Older python-apt modules don't export Package.installed_files and there
seems to be no other way to figure out if a package is
removed-but-not-purged, so we just always assume it's purged.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Merge branch 'fix-apt-purge' of git://github.com/madduck/ansible into purge
Merge branch 'purge' into devel