summaryrefslogtreecommitdiff
path: root/src/chroot-tools/chcleanup.in
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2021-07-19 17:06:58 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2021-07-26 19:20:09 -0400
commitf852d5876b8c0be70e3686efd4f0a005dbb53648 (patch)
treedc8bb4b038d041f09d166360ecd2517a88713c45 /src/chroot-tools/chcleanup.in
parentc64c8ddcdfcce76f41f7c37cccec8d4894ade2c1 (diff)
wip - multiple concernswip-2021-03
Diffstat (limited to 'src/chroot-tools/chcleanup.in')
-rw-r--r--src/chroot-tools/chcleanup.in30
1 files changed, 23 insertions, 7 deletions
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)" ;