From 16ab9a2b407fa500bd31848e51200f974c3ad756 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 22 Jul 2009 21:55:29 -0700 Subject: ftpdir-cleanup: Loop over arches for 'any' links Remove the hardcoded i686/x86_64 and loop over the ARCHES array in the config file, checking for valid symlinks. If none are found, remove the 'any' package Signed-off-by: Aaron Griffin --- misc-scripts/ftpdir-cleanup | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'misc-scripts') diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup index 22d227a..622d7ed 100755 --- a/misc-scripts/ftpdir-cleanup +++ b/misc-scripts/ftpdir-cleanup @@ -173,14 +173,16 @@ if [ -d "$ftppath_base/any" ]; then cd "$ftppath_base/any" for pkg in *$PKGEXT; do [ -f "$pkg" ] || continue # in case we get a file named "*.pkg.tar.gz" - ### TODO loop over arch in ${ARCHES[@]} ... something like this: - # teststring="" - # for arch in ${ARCHES[@]}; do - # teststring="$teststring -a ! -h $ftppath_base/$arch/$pkg" - # done - # teststring=$(echo $teststring | sed 's/^ -a//') - # if [ $teststring ]; then - if [ ! -h "$ftppath_base/i686/$pkg" -a ! -h "$ftppath_base/x86_64/$pkg" ]; then + found=0 + #check for any existing symlinks + for arch in ${ARCHES[@]}; do + if [ -h "$ftppath_base/$arch/$pkg" ]; then + found=1 + break + fi + done + if [ $found -eq 0 ]; then + # We found no symlinks to this, delete it ARCHINDEPFILES="$ARCHINDEPFILES $pkg" fi done -- cgit v1.2.3-24-g4f1b