mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 09:44:15 +02:00
fix: snap and arch categories mapping when nothing is retrieved from the cloud
This commit is contained in:
@@ -655,11 +655,8 @@ class ArchManager(SoftwareManager):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
def _is_wget_available(self):
|
def _is_wget_available(self):
|
||||||
try:
|
res = run_cmd('which wget')
|
||||||
new_subprocess(['wget', '--version'])
|
return res and not res.strip().startswith('which ')
|
||||||
return True
|
|
||||||
except FileNotFoundError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def is_enabled(self) -> bool:
|
def is_enabled(self) -> bool:
|
||||||
return self.enabled
|
return self.enabled
|
||||||
@@ -690,7 +687,10 @@ class ArchManager(SoftwareManager):
|
|||||||
self.dcache_updater.start()
|
self.dcache_updater.start()
|
||||||
self.comp_optimizer.start()
|
self.comp_optimizer.start()
|
||||||
self.aur_index_updater.start()
|
self.aur_index_updater.start()
|
||||||
self.categories_map = self.categories_downloader.get_categories()
|
categories = self.categories_downloader.get_categories()
|
||||||
|
|
||||||
|
if categories:
|
||||||
|
self.categories_map = categories
|
||||||
|
|
||||||
def list_updates(self, internet_available: bool) -> List[PackageUpdate]:
|
def list_updates(self, internet_available: bool) -> List[PackageUpdate]:
|
||||||
installed = self.read_installed(disk_loader=None, internet_available=internet_available).installed
|
installed = self.read_installed(disk_loader=None, internet_available=internet_available).installed
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
|
||||||
from typing import List, Set
|
from typing import List, Set
|
||||||
|
|
||||||
from bauh.api.abstract.handler import ProcessWatcher
|
from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess
|
||||||
from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess, ProcessHandler
|
|
||||||
|
|
||||||
RE_DEPS = re.compile(r'[\w\-_]+:[\s\w_\-\.]+\s+\[\w+\]')
|
RE_DEPS = re.compile(r'[\w\-_]+:[\s\w_\-\.]+\s+\[\w+\]')
|
||||||
RE_OPTDEPS = re.compile(r'[\w\._\-]+\s*:')
|
RE_OPTDEPS = re.compile(r'[\w\._\-]+\s*:')
|
||||||
|
|
||||||
|
|
||||||
def is_enabled() -> bool:
|
def is_enabled() -> bool:
|
||||||
try:
|
res = run_cmd('which pacman')
|
||||||
new_subprocess(['pacman', '--version'])
|
return res and not res.strip().startswith('which ')
|
||||||
return True
|
|
||||||
except FileNotFoundError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def get_mirrors(pkgs: Set[str]) -> dict:
|
def get_mirrors(pkgs: Set[str]) -> dict:
|
||||||
|
|||||||
@@ -143,7 +143,10 @@ class SnapManager(SoftwareManager):
|
|||||||
return ProcessHandler(watcher).handle(SystemProcess(subproc=snap.refresh_and_stream(pkg.name, root_password)))
|
return ProcessHandler(watcher).handle(SystemProcess(subproc=snap.refresh_and_stream(pkg.name, root_password)))
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
self.categories = self.categories_downloader.get_categories()
|
categories = self.categories_downloader.get_categories()
|
||||||
|
|
||||||
|
if categories:
|
||||||
|
self.categories = categories
|
||||||
|
|
||||||
def list_updates(self, internet_available: bool) -> List[PackageUpdate]:
|
def list_updates(self, internet_available: bool) -> List[PackageUpdate]:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user