summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/chcleanup9
-rwxr-xr-xsrc/chroot-tools/librechroot2
2 files changed, 3 insertions, 8 deletions
diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup
index a72f951..bfb65ce 100755
--- a/src/chroot-tools/chcleanup
+++ b/src/chroot-tools/chcleanup
@@ -50,11 +50,6 @@ msg2() {
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
-warning() {
- local mesg="$(_ "$1")"; shift
- printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
-}
-
error() {
local mesg="$(_ "$1")"; shift
printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
@@ -83,8 +78,8 @@ msg "Cleaning chroot..."
cp /repo/repo.db /var/lib/pacman/sync/repo.db
# Setup the temporary directory
-TEMPDIR="$(mktemp --tmpdir -d $(basename $0).XXXXX)"
-trap "rm -rf '$TEMPDIR'" EXIT
+TEMPDIR="$(mktemp --tmpdir -d ${0##*/}.XXXXXXXXXX)"
+trap "rm -rf -- $(printf '%q' "$TEMPDIR")" EXIT
cp -a /var/lib/pacman/sync "${TEMPDIR}/"
pkglist="${TEMPDIR}"/pkglist.txt
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index 9e74a62..4edcb2f 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -373,7 +373,7 @@ main() {
arch-nspawn "$copydir" bash -c 'pacman -Syu --noconfirm'
;;
clean-pkgs)
- trap "rm -f '$copydir'/bin/chcleanup '$copydir'/chrootexec" EXIT
+ trap "rm -f -- $(printf '%q ' "$copydir"/{bin/chcleanup,chrootexec})" EXIT
install -m755 "$(librelib chroot/chcleanup)" "$copydir/bin/chcleanup"
printf '%s\n' \
'#!/bin/bash' \