From f852d5876b8c0be70e3686efd4f0a005dbb53648 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Mon, 19 Jul 2021 17:06:58 -0400 Subject: wip - multiple concerns --- src/chroot-tools/chcleanup.in | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src/chroot-tools/chcleanup.in') diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in index 89a25c4..65bfb15 100644 --- a/src/chroot-tools/chcleanup.in +++ b/src/chroot-tools/chcleanup.in @@ -66,9 +66,23 @@ fi # This is intentionally hard-coded. source /etc/libretools.d/chroot.conf # sets $CHROOTEXTRAPKG -# NOTE: ARM chroots require 'fakeroot-tcp' (BR #2775) +CHROOTPKG=( $( pacman -Sgq base-devel) ) +CHROOTPKG+=() # DEBUG: normally empty - mandatory core package-set +WHITELIST_PKGS=() # DEBUG: normally empty - optional packages, possibly insane + +# FIXME: ARM chroots require 'fakeroot-tcp' (BR #2775) +#CHROOTPKG+=( fakeroot-tcp ) # armv7h qemu fakeroot_pkg=fakeroot$( [[ "$(uname -m)" == 'armv7l' ]] && echo '-tcp' ) -CHROOTPKG=( $( pacman -Sgq base-devel | sed "s|fakeroot|${fakeroot_pkg}|" ) ) +CHROOTPKG=( ${CHROOTPKG[*]/fakeroot/${fakeroot_pkg}/} ) + +# FIXME: host<->chroot glibc mismatch +WHITELIST_PKGS+=( glibc-linux4 ) # BR #3038 +# $ wget https://repo.archlinuxcn.org/x86_64/glibc-linux4-2.33-4-x86_64.pkg.tar.zst.sig +# $ wget https://repo.archlinuxcn.org/x86_64/glibc-linux4-2.33-4-x86_64.pkg.tar.zst +# $ pacman-key --verify glibc-linux4-2.33-4-x86_64.pkg.tar.zst.sig +# $ sudo librechroot -n autobuilder install-file glibc-linux4-2.33-4-x86_64.pkg.tar.zst +# $ sudo cp glibc-linux4-2.33-4-x86_64.pkg.tar.zst* /var/lib/archbuild/autobuilder/bill-auger/ +# $ sudo librechroot -n autobuilder enter # If we're running makepkg if [[ -f ./PKGBUILD ]]; then @@ -132,10 +146,10 @@ done # This is done by installing those into a temporary pacman DB; # then querying the DB for it's complete package list. msg2 "Collecting the minimal set of packages needed ..." -"${pacman_cmd[@]}" -S --dbonly --noscriptlet --needed --noconfirm \ - -- ${CHROOTPKG[*]} ${CHROOTEXTRAPKG[*]} ${DEPENDS[*]} \ - <&- >& "$ERROR_PKGS_FILE" -if (( $? != 0 )); then +if ! "${pacman_cmd[@]}" -S --dbonly --noscriptlet --needed --noconfirm \ + -- ${CHROOTPKG[*]} ${CHROOTEXTRAPKG[*]} ${DEPENDS[*]} \ + <&- >& "$ERROR_PKGS_FILE" +then error "Could not create a full list of packages, exiting." plain "This is likely caused by a dependency that could not be found." sed 's/^/ > /' < "$ERROR_PKGS_FILE" >&2 @@ -159,9 +173,11 @@ fi # (via the libremakepkg '-I' option), and to exit otherwise, warning the user to upgrade. # If the '-I' option was detected (!SANE), the stale packages are added to the whitelist. "${pacman_cmd[@]}" -Qq > "$WHITELIST_PKGS_FILE" +# echo "${WHITELIST_PKGS[@]}" >> "$WHITELIST_PKGS_FILE" +cat >> "$WHITELIST_PKGS_FILE" <<<${WHITELIST_PKGS[@]} if (( ${#stale_pkgs[*]} > 0 )); then insane_msg_1="Some (%d) essential packages are out-of-sync with the database." - insane_msg_2="Consider upgrading the chroot system before building this package." + insane_msg_2="Consider upgrading the chroot system before building packages." if ! $SANE; then warning "$insane_msg_1" "${#stale_pkgs[*]}" ; plain "$insane_msg_2" ; plain "(ignoring, per the '-I' option)" ; -- cgit v1.2.2