pmbootstrap install: refactor: move set_user() up (MR 1981)

Don't have the set_user() call weirdly between multiple commands
building the install_packages list. Move it up, together with the log
message announcing that the device rootfs is being built.

Update the comment above set_user(): there is no 'build' user anymore,
and at this point we only call it before actually installing the
packages for legacy reasons.
This commit is contained in:
Oliver Smith 2020-10-07 19:24:22 +02:00 committed by Martijn Braam
parent fc1ba9ba7b
commit 340329599b
No known key found for this signature in database
GPG Key ID: C4280ACB000B060F
1 changed files with 6 additions and 5 deletions

View File

@ -666,10 +666,14 @@ def install(args):
pmb.chroot.apk.install(args, pmb.config.install_native_packages,
build=False)
logging.info(f'*** (2/{steps} CREATE DEVICE ROOTFS("{args.device}") ***')
# Create user before installing packages, so post-install scripts of
# pmaports can figure out the username (legacy reasons: pmaports#820)
set_user(args)
# List all packages to be installed (including the ones specified by --add)
# and upgrade the installed packages/apkindexes
logging.info('*** (2/{0}) CREATE DEVICE ROOTFS ("{1}") ***'.format(steps,
args.device))
install_packages = (pmb.config.install_device_packages +
["device-" + args.device] +
get_kernel_package(args, args.device) +
@ -684,9 +688,6 @@ def install(args):
pmb.helpers.repo.update(args, args.deviceinfo["arch"])
# Create final user and remove 'build' user
set_user(args)
# Explicitly call build on the install packages, to re-build them or any
# dependency, in case the version increased
if args.extra_packages.lower() != "none":