summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-05-21 21:33:29 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2008-05-21 21:33:29 +0200
commit2343985fcc46852f5b4de82c70824fa1dd702bbf (patch)
treebd822ea4223072b28118d66ca19fb453831f5fe4
parent8685aaea284147536394969805c9b29c7da71188 (diff)
downloaddbscripts-2343985fcc46852f5b4de82c70824fa1dd702bbf.tar.gz
dbscripts-2343985fcc46852f5b4de82c70824fa1dd702bbf.tar.xz
Switch EXTRAFILES test to be more accurate
New test suggested by Thomas via cleanup2.sh script Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xcron-jobs/ftpdir-cleanup33
1 files changed, 19 insertions, 14 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 83c7cf1..576dd6e 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -69,41 +69,46 @@ done
cd "$ftppath"
for pkg in *$PKGEXT; do
- pkgname="$(getpkgname_ver ${filename})"
- if [ ! -d "$TMPDIR/$pkgname" ]; then
- EXTRAFILES="$EXTRAFILES $pkg"
+ pkgname="$(getpkgname $pkg)"
+ if [ "$pkg" != "$TMPDIR/$pkgname-*" -a "$(getpkgname $(basename $pkg))" = "$pkgname" ]; then
+ continue 2
fi
+ EXTRAFILES="$EXTRAFILE $pkg"
done
-
-
cd "$ftppath"
rm -rf ${TMPDIR}
-if [ -n "${DELETEFILES}" ]; then
- #rm -f ${DELETEFILES}
- #mv ${DELETEFILES} /home/package-cleanup/
- echo ""
-fi
-
echo "Scan complete for $reponame ($arch) at ${ftppath}"
if [ -n "$DELETEFILES" ]; then
- echo " The following files have been moved to package-cleanup:"
+ echo " The following files are out of date"
+ echo " They will be moved to /home/package-cleanup"
for f in $DELETEFILES; do
echo " $f"
done
fi
echo ""
if [ -n "$MISSINGFILES" ]; then
- echo " The following files are missing in the repo:"
+ echo " The following files are missing in the repo"
for f in $MISSINGFILES; do
echo " $f"
done
fi
echo ""
if [ -n "$EXTRAFILES" ]; then
- echo " The following files are in the repo but not the db:"
+ echo " The following files are in the repo but not the db"
+ echo " They will be moved to /home/package-cleanup"
for f in $EXTRAFILES; do
echo " $f"
done
fi
+
+if [ -n "${DELETEFILES}" ]; then
+ #mv ${DELETEFILES} /home/package-cleanup/
+ echo ""
+fi
+
+if [ -n "${EXTRAFILES}" ]; then
+ #mv ${EXTRAFILES} /home/package-cleanup/
+ echo ""
+fi