Projet

Général

Profil

0001-versions-middleware-don-t-fail-on-corrupted-apt-cach.patch

Frédéric Péters, 07 octobre 2018 08:39

Télécharger (1,42 ko)

Voir les différences:

Subject: [PATCH] versions middleware: don't fail on corrupted apt cache
 (#27056)

 hobo/scrutiny/wsgi/middleware.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
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
-