summaryrefslogtreecommitdiffstats
path: root/misc-scripts
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-07-23 06:55:29 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-07-23 06:55:29 +0200
commit16ab9a2b407fa500bd31848e51200f974c3ad756 (patch)
tree7ec08da82121f37e5165f48ede349a499a3c1dac /misc-scripts
parentada0109d158c6f657137e7e6e8403ff32b23abd4 (diff)
downloaddbscripts-16ab9a2b407fa500bd31848e51200f974c3ad756.tar.gz
dbscripts-16ab9a2b407fa500bd31848e51200f974c3ad756.tar.xz
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 <aaronmgriffin@gmail.com>
Diffstat (limited to 'misc-scripts')
-rwxr-xr-xmisc-scripts/ftpdir-cleanup18
1 files changed, 10 insertions, 8 deletions
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