0001-versions-middleware-don-t-fail-on-corrupted-apt-cach.patch
hobo/scrutiny/wsgi/middleware.py | ||
---|---|---|
75 | 75 |
if project_name in cls.ENTROUVERT_PACKAGES: |
76 | 76 |
packages_version[project_name] = version |
77 | 77 |
# get versions from Debian packages |
78 |
debian_cache = None |
|
78 | 79 |
if apt_cache: |
79 |
cache = apt_cache.Cache() |
|
80 |
try: |
|
81 |
debian_cache = apt_cache.Cache() |
|
82 |
except SystemError: |
|
83 |
pass |
|
84 |
if debian_cache: |
|
80 | 85 |
versions = [(p.name, p.installed.source_name, p.installed.version) \ |
81 |
for p in cache if p.installed and ( |
|
86 |
for p in debian_cache if p.installed and (
|
|
82 | 87 |
(p.installed and p.installed.origins[0].origin == "Entr'ouvert") or |
83 | 88 |
(p.candidate and p.candidate.origins[0].origin == "Entr'ouvert"))] |
84 | 89 |
for name, project_name, version in versions: |
85 |
- |