mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Who knows, maybe this folder doesn't exist in some context
This commit is contained in:
parent
2fec4a6c64
commit
6fc6d6cfe6
1 changed files with 2 additions and 0 deletions
|
@ -477,5 +477,7 @@ def dpkg_is_broken():
|
||||||
# If dpkg is broken, /var/lib/dpkg/updates
|
# If dpkg is broken, /var/lib/dpkg/updates
|
||||||
# will contains files like 0001, 0002, ...
|
# will contains files like 0001, 0002, ...
|
||||||
# ref: https://sources.debian.org/src/apt/1.4.9/apt-pkg/deb/debsystem.cc/#L141-L174
|
# 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)
|
return any(re.match("^[0-9]+$", f)
|
||||||
for f in os.listdir("/var/lib/dpkg/updates/"))
|
for f in os.listdir("/var/lib/dpkg/updates/"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue