summaryrefslogtreecommitdiff
path: root/src/chroot-tools/chcleanup
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools/chcleanup')
-rwxr-xr-xsrc/chroot-tools/chcleanup13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup
index a43065b..9ad121e 100755
--- a/src/chroot-tools/chcleanup
+++ b/src/chroot-tools/chcleanup
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -eE
-# (c) Nicolás Reynolds <fauno@parabola.nu>
+# Copyright (C) Nicolás Reynolds <fauno@parabola.nu>
# Released under GPLv3
#
# Performs chroot cleanup smartly, it only removes the unneeded packages or
@@ -53,19 +53,18 @@ fi
source /etc/libretools.d/chroot.conf
# If we're running makepkg
-if [ -f PKGBUILD ]; then
+if [[ -f PKGBUILD ]]; then
export CARCH="$(. /etc/makepkg.conf; printf '%s' "$CARCH")"
- source PKGBUILD
+ source ./PKGBUILD
CHROOTEXTRAPKG+=("${depends[@]}"
"${makedepends[@]}"
"${checkdepends[@]}")
fi
msg "Cleaning chroot..."
-msg2 "Fetching updated package lists..."
-pacman -Sy || {
- warning "There was an error updating package lists, ignoring."
-}
+
+# Sync the local repo with pacman
+cp /repo/repo.db /var/lib/pacman/sync/repo.db
# Setup the temporary directory
TEMPDIR="$(mktemp --tmpdir -d $(basename $0).XXXXX)"