diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-05-21 15:33:29 -0400 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-05-21 15:33:29 -0400 |
commit | 2343985fcc46852f5b4de82c70824fa1dd702bbf (patch) | |
tree | bd822ea4223072b28118d66ca19fb453831f5fe4 | |
parent | 8685aaea284147536394969805c9b29c7da71188 (diff) |
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-x | cron-jobs/ftpdir-cleanup | 33 |
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 |