aboutsummaryrefslogtreecommitdiff
path: root/whatmaps
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-09-24 13:25:36 +0200
committerGuido Günther <agx@sigxcpu.org>2010-09-25 15:47:57 +0200
commit1f3b0f8a640d948849181fe07f4a5fe4431e95b9 (patch)
tree780abd32a26d199ad7383d321b63f62f9c31fa90 /whatmaps
parent050d3b21bf30bbd6f60d4819600c7d1550e4e5fd (diff)
Fixups for Lenny
Cope with older apt_pkg and don't substitute disto_id, distro_codename due to the lack of the lsb_release python module
Diffstat (limited to 'whatmaps')
-rwxr-xr-xwhatmaps26
1 files changed, 9 insertions, 17 deletions
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