pmbootstrap install --no-local-pkgs: new option (MR 1951)

Don't install locally compiled packages and package signing keys. This
will be used for the official images generated with pmbootstrap.
This commit is contained in:
Oliver Smith 2020-06-22 13:40:30 +02:00 committed by Alexey Min
parent 05849a9f80
commit c8d581e749
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
3 changed files with 27 additions and 3 deletions

View file

@ -1,5 +1,6 @@
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import json
import logging
import os
@ -252,6 +253,18 @@ def install(args):
" different cipher with 'pmbootstrap install --cipher=..."
" --fde --android-recovery-zip'.")
# Don't install locally compiled packages and package signing keys
if not args.install_local_pkgs:
# Implies that we don't build outdated packages (overriding the answer
# in 'pmbootstrap init')
args.build_pkgs_on_install = False
# Safest way to avoid installing local packages is having none
if glob.glob(f"{args.work}/packages/*"):
raise ValueError("--no-local-pkgs specified, but locally built"
" packages found. Consider 'pmbootstrap zap -p'"
" to delete them.")
pmb.install.install(args)