diff options
author | Skycoder42 | 2019-03-24 21:34:27 +0100 |
---|---|---|
committer | Skycoder42 | 2019-03-24 21:34:27 +0100 |
commit | b50a3272f12091c35b97564c0108aa748ad418ad (patch) | |
tree | 25da2005194e3733e9bed58dbab47cf501548053 | |
parent | 533f1511d7a28308c36addedeedc557bbbdfb310 (diff) | |
download | aur-b50a3272f12091c35b97564c0108aa748ad418ad.tar.gz |
update to 1.1.0
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | paccache-hook.conf | 3 | ||||
-rw-r--r-- | paccache-hook.sh | 17 |
4 files changed, 24 insertions, 8 deletions
@@ -1,6 +1,6 @@ pkgbase = paccache-hook pkgdesc = A configurable hook to cleanup the pacman package cache using paccache - pkgver = 1.0.0 + pkgver = 1.1.0 pkgrel = 1 arch = any license = BSD @@ -10,8 +10,8 @@ pkgbase = paccache-hook source = paccache-hook.conf source = paccache-hook.sh source = paccache-hook.hook - sha256sums = 7697d91b064bdb1c19fb78a2c3ec997e76b53c3b0df2cba219738c36e11266f8 - sha256sums = 21070f4e2069a5f4535482725b27fef84664610126c04260da255ca5d39f1fd3 + sha256sums = 0aba81744ed33eae4fbb135da75d905baab46362f0230e7c7a833c4e8734ccfc + sha256sums = 2a4b997c371956d2a03d1ba8ae5b54fc403e354231b6c6798ae7b0d18d06cdee sha256sums = fdd80cc2ec88445ac9c5fadf2b4053eb0d4864485952a8d9858d6cc3d34c97ce pkgname = paccache-hook @@ -1,6 +1,6 @@ # Maintainer: Felix Barz <skycoder42.de@gmx.de> pkgname=paccache-hook -pkgver=1.0.0 +pkgver=1.1.0 pkgrel=1 pkgdesc="A configurable hook to cleanup the pacman package cache using paccache" arch=('any') @@ -10,8 +10,8 @@ conflicts=('pacman-cleanup-hook') source=("$pkgname.conf" "$pkgname.sh" "$pkgname.hook") -sha256sums=('7697d91b064bdb1c19fb78a2c3ec997e76b53c3b0df2cba219738c36e11266f8' - '21070f4e2069a5f4535482725b27fef84664610126c04260da255ca5d39f1fd3' +sha256sums=('0aba81744ed33eae4fbb135da75d905baab46362f0230e7c7a833c4e8734ccfc' + '2a4b997c371956d2a03d1ba8ae5b54fc403e354231b6c6798ae7b0d18d06cdee' 'fdd80cc2ec88445ac9c5fadf2b4053eb0d4864485952a8d9858d6cc3d34c97ce') backup=("etc/$pkgname.conf") diff --git a/paccache-hook.conf b/paccache-hook.conf index 2ffe12b655ce..ee0f4af11778 100644 --- a/paccache-hook.conf +++ b/paccache-hook.conf @@ -1,9 +1,12 @@ extra_args= +cache_dirs=() installed=true installed_keep=2 installed_extra_args= +installed_move_to= uninstalled=true uninstalled_keep=0 uninstalled_extra_args= +uninstalled_move_to= diff --git a/paccache-hook.sh b/paccache-hook.sh index 034f05276c04..78d48a43ca9e 100644 --- a/paccache-hook.sh +++ b/paccache-hook.sh @@ -2,12 +2,25 @@ . /etc/paccache-hook.conf +cache_args="" +for cdir in $cache_dirs; do + cache_args="$cache_args -c $cdir" +done + if [ "$installed" = true ]; then echo "Removing old installed packages..." - paccache "-rk${installed_keep:-2}" $extra_args $installed_extra_args + if [ -n "$installed_move_to" ]; then + paccache $cache_args -m "$installed_move_to" "-k${installed_keep:-2}" $extra_args $installed_extra_args + else + paccache $cache_args "-rk${installed_keep:-2}" $extra_args $installed_extra_args + fi fi if [ "$uninstalled" = true ]; then echo "Removing old uninstalled packages..." - paccache "-ruk${uninstalled_keep:-0}" $extra_args $uninstalled_extra_args + if [ -n "$uninstalled_move_to" ]; then + paccache $cache_args -m "$uninstalled_move_to" "-uk${uninstalled_keep:-0}" $extra_args $uninstalled_extra_args + else + paccache $cache_args "-ruk${uninstalled_keep:-0}" $extra_args $uninstalled_extra_args + fi fi |