Skip to content

Commit

Permalink
acbs-build: add --force-use-apt argument ...
Browse files Browse the repository at this point in the history
... to always only allow user use `apt` as package manager
  • Loading branch information
eatradish committed Aug 7, 2024
1 parent 82b0821 commit 6c23eb0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions acbs-build
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def main() -> None:
help='Override abbs tree directory')
parser.add_argument('-z', '--temp-dir', nargs=1, dest='acbs_temp_dir',
help='Override temp directory')
parser.add_argument('--force-use-apt', help="Only use apt to install dependency", action="store_true", dest="force_use_apt")

args = parser.parse_args()
if args.acbs_temp_dir:
Expand Down
3 changes: 2 additions & 1 deletion acbs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def __init__(self, args) -> None:
self.package_cursor = 0
self.reorder = args.reorder
self.save_list = args.save_list
self.force_use_apt = args.force_use_apt
# static vars
self.autobuild_conf_dir = AUTOBUILD_CONF_DIR
self.conf_dir = CONF_DIR
Expand Down Expand Up @@ -333,7 +334,7 @@ def build_sequential(self, build_timings, packages: List[ACBSPackageInfo]):
build_dir = os.path.join(build_dir, subdir)
if task.installables:
logging.info('Installing dependencies from repository...')
install_from_repo(task.installables)
install_from_repo(task.installables, self.force_use_apt)
start = time.monotonic()
task_name = f'{task.name} ({task.bin_arch} @ {task.epoch + ":" if task.epoch else ""}{task.version}-{task.rel})'
try:
Expand Down
4 changes: 2 additions & 2 deletions acbs/pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def check_if_available(name: str) -> bool:
return False


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

oma_is_success = install_from_repo_oma(packages)
Expand Down

0 comments on commit 6c23eb0

Please sign in to comment.