[dbscripts,v2,8/8] ftpdir-cleanup, sourceballs: swap out [ -ge 1 ] for (( > 0 ))

Message ID 20180218171736.4473-9-lukeshu@lukeshu.com
State Rejected
Headers show
Series PKGEXT fixup | expand

Commit Message

Luke Shumaker Feb. 18, 2018, 5:17 p.m. UTC
From: Luke Shumaker <lukeshu@parabola.nu>

This is based on a patch by Eli Schwartz <eschwartz@archlinux.org>
---
 cron-jobs/ftpdir-cleanup | 2 +-
 cron-jobs/sourceballs    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 6a6c82f..fac05bd 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -88,7 +88,7 @@  for f in "${CLEANUP_DESTDIR}"/**/*${PKGEXT_glob}; do
 		old_pkgs+=("${f##*/}")
 	fi
 done
-if [ ${#old_pkgs[@]} -ge 1 ]; then
+if (( ${#old_pkgs[@]} > 0 )); then
 	msg "Removing old packages from the cleanup directory..."
 	for old_pkg in ${old_pkgs[@]}; do
 		msg2 "${old_pkg}"
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index c47d5ad..d8c0a43 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -144,7 +144,7 @@  for f in "${SOURCE_CLEANUP_DESTDIR}"/*${SRCEXT}; do
 		old_pkgs+=("${f##*/}")
 	fi
 done
-if [ ${#old_pkgs[@]} -ge 1 ]; then
+if (( ${#old_pkgs[@]} > 0 )); then
 	msg "Removing old source packages from the cleanup directory..."
 	for old_pkg in ${old_pkgs[@]}; do
 		msg2 "${old_pkg}"