summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/20services4
-rw-r--r--setup.py17
-rwxr-xr-xwhatmaps26
3 files changed, 16 insertions, 31 deletions
diff --git a/apt/20services b/apt/20services
index f9f4147..9cc6cf6 100644
--- a/apt/20services
+++ b/apt/20services
@@ -3,6 +3,6 @@ Whatmaps::Enable-Restart "0";
// What updates are considered security updates
Whatmaps::Security-Update-Origins {
- "${distro_id} stable";
- "${distro_id} ${distro_codename}-security";
+ "Debian stable";
+ "Debian stable-security";
};
diff --git a/setup.py b/setup.py
index f79ef8e..cef1d55 100644
--- a/setup.py
+++ b/setup.py
@@ -3,18 +3,11 @@
from distutils.core import setup
-data_files = []
-
-try:
- import lsb_release
- if lsb_release.get_distro_information()['ID'] in [ 'Debian' ]:
- data_files = [('../etc/apt/apt.conf.d/',
- ['apt/50whatmaps_apt']),
- ('../etc/apt/apt.conf.d/',
- ['apt/20services']),
- ]
-except ImportError:
- pass
+data_files = [('../etc/apt/apt.conf.d/',
+ ['apt/50whatmaps_apt']),
+ ('../etc/apt/apt.conf.d/',
+ ['apt/20services']),
+ ]
setup(name = "whatmaps",
author = 'Guido Günther',
diff --git a/whatmaps b/whatmaps
index 379fc61..56bdf3d 100755
--- a/whatmaps
+++ b/whatmaps
@@ -243,18 +243,10 @@ class DebianDistro(Distro):
@classmethod
def _security_update_origins(klass):
- "Determine security update origins from apt configuration"
- codename = lsb_release.get_distro_information()['CODENAME']
- def _subst(line):
- mapping = {'distro_codename' : codename,
- 'distro_id' : klass.id, }
- return string.Template(line).substitute(mapping)
-
origins = []
- for s in apt_pkg.config.value_list('Whatmaps::Security-Update-Origins'):
+ for s in apt_pkg.Config.ValueList('Whatmaps::Security-Update-Origins'):
(distro_id, distro_codename) = s.split()
- origins.append((_subst(distro_id),
- _subst(distro_codename)))
+ origins.append((distro_id, distro_codename))
logging.debug("Security Update Origins: %s", origins)
return origins
@@ -264,20 +256,20 @@ class DebianDistro(Distro):
"""Filter on security updates"""
apt_pkg.init()
- acquire = apt_pkg.Acquire()
- cache = apt_pkg.Cache()
+ acquire = apt_pkg.GetAcquire()
+ cache = apt_pkg.GetCache()
security_update_origins = klass._security_update_origins()
security_updates = {}
for pkg in pkgs.values():
cache_pkg = cache[pkg.name]
- for cache_version in cache_pkg.version_list:
- if pkg.version == cache_version.ver_str:
- for pfile, _ in cache_version.file_list:
+ for cache_version in cache_pkg.VersionList:
+ if pkg.version == cache_version.VerStr:
+ for pfile, _ in cache_version.FileList:
for origin in security_update_origins:
- if pfile.origin == origin[0] and \
- pfile.archive == origin[1]:
+ if pfile.Origin == origin[0] and \
+ pfile.Archive == origin[1]:
security_updates[pkg] = pkg
break
return security_updates