Skip to content

Commit

Permalink
fix: not allow riscv64 use oma to fetch source
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish authored and MingcongBai committed Aug 7, 2024
1 parent e333f55 commit cad9a28
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions acbs/pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Dict, List

from acbs.base import ACBSPackageInfo
from acbs.utils import get_arch_name

installed_cache: Dict[str, bool] = {}
available_cache: Dict[str, bool] = {}
Expand Down Expand Up @@ -121,21 +122,29 @@ def check_if_available(name: str) -> bool:


def install_from_repo(packages: List[str]):
if get_arch_name() == "riscv64":
return install_from_repo_apt(packages)

oma_is_success = install_from_repo_oma(packages)

if not oma_is_success:
logging.debug('Installing %s' % packages)
escaped = []
for package in packages:
escaped.append(escape_package_name_install(package))
command = ['apt-get', 'install', '-y', '-o', 'Dpkg::Options::=--force-confnew']
command.extend(escaped)
try:
subprocess.check_call(command, env={'DEBIAN_FRONTEND': 'noninteractive'})
except subprocess.CalledProcessError:
logging.warning(
'Failed to install dependencies, attempting to correct issues...')
fix_pm_states(escaped)
install_from_repo_apt(packages)

return

def install_from_repo_apt(packages: List[str]):
logging.debug('Installing %s' % packages)
escaped = []
for package in packages:
escaped.append(escape_package_name_install(package))
command = ['apt-get', 'install', '-y', '-o', 'Dpkg::Options::=--force-confnew']
command.extend(escaped)
try:
subprocess.check_call(command, env={'DEBIAN_FRONTEND': 'noninteractive'})
except subprocess.CalledProcessError:
logging.warning(
'Failed to install dependencies, attempting to correct issues...')
fix_pm_states(escaped)
return

def install_from_repo_oma(packages: List[str]) -> bool:
Expand Down

0 comments on commit cad9a28

Please sign in to comment.