summarylogtreecommitdiffstats
path: root/paccache-hook.sh
diff options
context:
space:
mode:
authorSkycoder422022-11-27 13:15:45 +0100
committerSkycoder422022-11-27 13:15:45 +0100
commit20dd6418517e66ac1bda19eeeda5957cccb5fd90 (patch)
tree93233dd930f48dcba192336628d72a12ba2c2c55 /paccache-hook.sh
parentb50a3272f12091c35b97564c0108aa748ad418ad (diff)
downloadaur-20dd6418517e66ac1bda19eeeda5957cccb5fd90.tar.gz
fix configuration parsing
Diffstat (limited to 'paccache-hook.sh')
-rw-r--r--paccache-hook.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/paccache-hook.sh b/paccache-hook.sh
index 78d48a43ca9e..ce134e7d3a47 100644
--- a/paccache-hook.sh
+++ b/paccache-hook.sh
@@ -1,13 +1,14 @@
-#!/bin/sh
+#!/bin/bash
+set -e
. /etc/paccache-hook.conf
cache_args=""
-for cdir in $cache_dirs; do
+for cdir in ${cache_dirs[@]}; do
cache_args="$cache_args -c $cdir"
done
-if [ "$installed" = true ]; then
+if [ "$installed" = "true" ]; then
echo "Removing old installed packages..."
if [ -n "$installed_move_to" ]; then
paccache $cache_args -m "$installed_move_to" "-k${installed_keep:-2}" $extra_args $installed_extra_args
@@ -16,7 +17,7 @@ if [ "$installed" = true ]; then
fi
fi
-if [ "$uninstalled" = true ]; then
+if [ "$uninstalled" = "true" ]; then
echo "Removing old uninstalled packages..."
if [ -n "$uninstalled_move_to" ]; then
paccache $cache_args -m "$uninstalled_move_to" "-uk${uninstalled_keep:-0}" $extra_args $uninstalled_extra_args