Fix requirements
This commit is contained in:
+18
-5
@@ -1,14 +1,21 @@
|
|||||||
"""Install system packages."""
|
"""Install system packages."""
|
||||||
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from .const import PROGRAM_DIR
|
from .const import PROGRAM_DIR
|
||||||
from .whiptail import run_with_gauge
|
from .whiptail import run_with_gauge
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger()
|
||||||
|
|
||||||
|
|
||||||
def packages_installed(*packages) -> bool:
|
def packages_installed(*packages) -> bool:
|
||||||
for package in packages:
|
for package in packages:
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(["dpkg", "--status", str(package)])
|
subprocess.check_call(
|
||||||
|
["dpkg", "--status", str(package)],
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -26,10 +33,16 @@ def install_packages_nogui(*packages, update: bool = True) -> bool:
|
|||||||
["sudo", "apt-get", "install", "--yes"] + [str(p) for p in packages]
|
["sudo", "apt-get", "install", "--yes"] + [str(p) for p in packages]
|
||||||
)
|
)
|
||||||
|
|
||||||
for command in commands:
|
try:
|
||||||
subprocess.check_call(
|
for command in commands:
|
||||||
command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
|
subprocess.check_call(
|
||||||
)
|
command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
_LOGGER.exception("Unexpected error installing packages: %s", packages)
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def install_packages(
|
def install_packages(
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
wyoming==1.4.2
|
wyoming==1.5.0
|
||||||
zeroconf==0.88.0
|
zeroconf==0.88.0
|
||||||
pyring-buffer==1.0.0
|
pyring-buffer==1.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user