summaryrefslogtreecommitdiffstats
path: root/misc-scripts
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2010-02-16 00:44:46 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2010-04-28 18:51:34 +0200
commite284d06d6cf63665cbadcb65e3a09bbd18027bd1 (patch)
tree19b18ccb8963b450d99d30d136a8f92937b98969 /misc-scripts
parentc7e3c501f01b6429519e2b8466d6bd8e2f7e22b9 (diff)
downloaddbscripts-e284d06d6cf63665cbadcb65e3a09bbd18027bd1.tar.gz
dbscripts-e284d06d6cf63665cbadcb65e3a09bbd18027bd1.tar.xz
Change ftpdir-cleanup scripts for package pooling
* The per repo script now simply removes files as they should all be symlinks at this time * The cron job script will do the extra job of checking the global pool. If there are no more symlinks, move the pooled package Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'misc-scripts')
-rwxr-xr-xmisc-scripts/ftpdir-cleanup15
1 files changed, 6 insertions, 9 deletions
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index 351c0f4..97f46b2 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -1,12 +1,11 @@
#!/bin/bash
-if [ $# -ne 2 ]; then
- echo "usage: $(basename $0) <reponame> <dest-dir>"
+if [ $# -ne 1 ]; then
+ echo "usage: $(basename $0) <reponame>"
exit 1
fi
reponame=$1
-dest=$2
############################################################
@@ -65,6 +64,7 @@ for arch in ${ARCHES[@]}; do
cd "$ftppath"
for pkg in $CLEANUP_TMPDIR/*; do
+ [ -f "${pkg}" ] || continue
filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1)
if [ ! -e "${filename}" ]; then
@@ -124,7 +124,6 @@ for arch in ${ARCHES[@]}; do
if [ -n "$DELETEFILES" ]; then
echo " The following files are out of date"
- echo " They will be moved to '$dest'"
for f in $DELETEFILES; do
echo " $f"
done
@@ -150,14 +149,13 @@ for arch in ${ARCHES[@]}; do
if [ -n "$EXTRAFILES" ]; then
echo " The following files are in the repo but not the db"
- echo " They will be moved to '$dest'"
for f in $EXTRAFILES; do
echo " $f"
done
fi
if [ -n "${DELETEFILES}" ]; then
- ${CLEANUP_DRYRUN} || mv ${DELETEFILES} "$dest"
+ ${CLEANUP_DRYRUN} || rm -f ${DELETEFILES}
echo ""
fi
@@ -167,7 +165,7 @@ for arch in ${ARCHES[@]}; do
fi
if [ -n "${EXTRAFILES}" ]; then
- ${CLEANUP_DRYRUN} || mv ${EXTRAFILES} "$dest"
+ ${CLEANUP_DRYRUN} || rm -f ${EXTRAFILES}
echo ""
fi
@@ -197,7 +195,6 @@ fi
if [ -n "$ARCHINDEPFILES" ]; then
echo " The following architecture independent packages"
echo " are not symlinked in the architecture repositories."
- echo " They will be moved to '$dest'"
for f in $ARCHINDEPFILES; do
echo " $f"
done
@@ -205,6 +202,6 @@ fi
if [ -d "$ftppath_base/any" -a -n "${ARCHINDEPFILES}" ]; then
cd "$ftppath_base/any"
- ${CLEANUP_DRYRUN} || mv ${ARCHINDEPFILES} "$dest"
+ ${CLEANUP_DRYRUN} || rm -f ${ARCHINDEPFILES}
echo ""
fi