summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2021-03-08 22:58:37 -0500
committerAndreas Grapentin <andreas@grapentin.org>2022-01-18 17:31:57 +0100
commit06ec1bec5322256a25d00a70f21388682c40b8bd (patch)
tree0ef91d5b8123b84cbb5a1125e1546df350466f8e
parente913e9a91f0290155a533601b1ba4bab038ade06 (diff)
housekeeping
-rw-r--r--src/chroot-tools/chcleanup.in24
-rwxr-xr-xsrc/chroot-tools/libremakepkg3
2 files changed, 14 insertions, 13 deletions
diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in
index 10256dd..a76dd67 100644
--- a/src/chroot-tools/chcleanup.in
+++ b/src/chroot-tools/chcleanup.in
@@ -63,7 +63,7 @@ fi
# NOTE: The in-chroot pkgconfdir is non-configurable.
# This is intentionally hard-coded.
-source /etc/libretools.d/chroot.conf
+source /etc/libretools.d/chroot.conf # sets $CHROOTEXTRAPKG
# NOTE: ARM chroots require 'fakeroot-tcp' (BR #2775)
fakeroot_pkg=fakeroot$( [[ "$(uname -m)" == 'armv7l' ]] && echo '-tcp' )
@@ -100,7 +100,7 @@ cp -a -t "${TEMPDIR}/db" -- /var/lib/pacman/sync
ln -sfT -- /dev/null "$TEMPDIR/hooks/${hook##*/}"
done
done
-pacman=(pacman --dbpath="$TEMPDIR/db" --hookdir="$TEMPDIR/hooks")
+pkglist_cmd=(pacman --dbpath="$TEMPDIR/db" --hookdir="$TEMPDIR/hooks")
# Do our best to preload the scratch DB with CHROOTPKG and
# CHROOTEXTRAPKG packages. This is purely an optimization step. The
@@ -112,29 +112,29 @@ while read -r pkg; do
if [[ -d /var/lib/pacman/local/$pkg ]]; then
cp -a -T -- "/var/lib/pacman/local/$pkg" "$TEMPDIR/db/local/$pkg"
fi
-done < <("${pacman[@]}" -Sp --print-format='%n-%v' -- "${CHROOTPKG[@]}" "${CHROOTEXTRAPKG[@]}")
+done < <("${pkglist_cmd[@]}" -Sp --print-format='%n-%v' -- "${CHROOTPKG[@]}" "${CHROOTEXTRAPKG[@]}")
# Get the full list of packages needed by dependencies, including the base system
msg2 "Creating a full list of packages..."
-for var in CHROOTPKG CHROOTEXTRAPKG DEPENDS; do
- declare -n pkgsref="$var"
- if [[ $var = DEPENDS ]]; then
- mapfile -t pkgs < <("${pacman[@]}" -T -- "${pkgsref[@]}")
+for pkglist in CHROOTPKG CHROOTEXTRAPKG DEPENDS; do
+ declare -n pkgsref="$pkglist"
+ if [[ $pkglist = DEPENDS ]]; then
+ mapfile -t pkgs < <("${pkglist_cmd[@]}" -T -- "${pkgsref[@]}")
else
pkgs=("${pkgsref[@]}")
fi
- if (( ${#pkgs[@]} == 0 )); then
- continue
+ (( ${#pkgs[@]} > 0 )) || continue
+
fi
- "${pacman[@]}" -S --dbonly --noscriptlet --needed --noconfirm -- "${pkgs[@]}" <&- >& "$TEMPDIR/pacman.txt" || ret=$?
+ "${pkglist_cmd[@]}" -S --dbonly --noscriptlet --needed --noconfirm -- "${pkgs[@]}" <&- >& "$TEMPDIR/pacman.txt" || ret=$?
if (( ret != 0 )); 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/^/ > /' <"$TEMPDIR/pacman.txt" >&2
+ sed 's/^/ > /' < "$TEMPDIR/pacman.txt" >&2
exit $ret
fi
done
-"${pacman[@]}" -Qq >"$TEMPDIR/pkglist.txt"
+"${pkglist_cmd[@]}" -Qq > "$TEMPDIR/pkglist.txt"
# Diff installed packages against a clean chroot then remove leftovers
packages=($(comm -23 <(pacman -Qq | sort -u) \
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
index 995a7ad..14ec0ff 100755
--- a/src/chroot-tools/libremakepkg
+++ b/src/chroot-tools/libremakepkg
@@ -184,7 +184,7 @@ usage() {
this unless you have a special reason, its
use is a violation of Parabola policy." \
'-R' 'Repackage contents of the package without rebuilding' \
- "-S <$(_ FILE)>" 'Use an existing --allsource source-package (not-yrt-implemented)' \
+ "-S <$(_ FILE)>" 'Use an existing --allsource source-package (not-yet-implemented)' \
'-h' 'Show this message'
}
@@ -269,6 +269,7 @@ main() {
# Make sure that the various *DEST directories exist
sudo -u "$LIBREUSER" mkdir -p -- "$PKGDEST" "$SRCDEST" "$SRCPKGDEST" "$LOGDEST"
+
# OK, we are starting now ##############################################
if $INCHROOT; then