From 6fc6d6cfe6b6045de4251cb9dac01d2acae370f9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 22 Feb 2019 15:16:07 +0100 Subject: [PATCH] Who knows, maybe this folder doesn't exist in some context --- src/yunohost/utils/packages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yunohost/utils/packages.py b/src/yunohost/utils/packages.py index 9cb3bd974..e10de6493 100644 --- a/src/yunohost/utils/packages.py +++ b/src/yunohost/utils/packages.py @@ -477,5 +477,7 @@ def dpkg_is_broken(): # If dpkg is broken, /var/lib/dpkg/updates # will contains files like 0001, 0002, ... # ref: https://sources.debian.org/src/apt/1.4.9/apt-pkg/deb/debsystem.cc/#L141-L174 + if not os.path.isdir("/var/lib/dpkg/updates/"): + return False return any(re.match("^[0-9]+$", f) for f in os.listdir("/var/lib/dpkg/updates/"))