diff options
author | Rémy Oudompheng <remyoudompheng@gmail.com> | 2011-04-01 00:54:57 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-04-02 02:10:01 +0200 |
commit | a7b293ad4d819fa77592818af27f7c2a3b9b2ca4 (patch) | |
tree | d45d1b6930c7df46bc6970cd5951622d64930926 /cron-jobs/ftpdir-cleanup | |
parent | 9abfc4fe1d3e31bc7bd03287029aacd8287ce6ee (diff) | |
download | dbscripts-a7b293ad4d819fa77592818af27f7c2a3b9b2ca4.tar.gz dbscripts-a7b293ad4d819fa77592818af27f7c2a3b9b2ca4.tar.xz |
Add signature files to update/move/remove targets
Signature files are optional and the previous behaviour
is unchanged when signatures files do not exist.
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-x | cron-jobs/ftpdir-cleanup | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 09e8a49..bb1661a 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -10,9 +10,12 @@ clean_pkg() { if ! ${CLEANUP_DRYRUN}; then for pkg in "$@"; do if [ -h "$pkg" ]; then - rm -f "$pkg" + rm -f "$pkg" "$pkg.sig" else mv -f "$pkg" "$CLEANUP_DESTDIR" + if [ -e "$pkg.sig" ]; then + mv -f "$pkg.sig" "$CLEANUP_DESTDIR" + fi touch "${CLEANUP_DESTDIR}/$(basename ${pkg})" fi done @@ -100,7 +103,10 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from the cleanup directory..." for old_pkg in ${old_pkgs[@]}; do msg2 "${old_pkg}" - ${CLEANUP_DRYRUN} || rm -f "${CLEANUP_DESTDIR}/${old_pkg}" + if ! ${CLEANUP_DRYRUN}; then + rm -f "${CLEANUP_DESTDIR}/${old_pkg}" + rm -f "${CLEANUP_DESTDIR}/${old_pkg}.sig" + fi done fi |