summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config1
-rwxr-xr-xmisc-scripts/ftpdir-cleanup12
2 files changed, 8 insertions, 5 deletions
diff --git a/config b/config
index 92def37..7864532 100644
--- a/config
+++ b/config
@@ -5,6 +5,7 @@ FTP_OS_SUFFIX="os"
SVNREPO="file:///srv/svn-packages"
CLEANUP_DESTDIR="/srv/package-cleanup"
+CLEANUP_DRYRUN=false
SOURCE_CLEANUP_DESTDIR="/srv/source-cleanup"
STAGING="$HOME/staging"
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index f0f89a3..6a69d72 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -13,6 +13,8 @@ dest=$2
. "$(dirname $0)/../db-functions"
. "$(dirname $0)/../config"
+${CLEANUP_DRYRUN} && echo 'dry run mode is active'
+
ftppath_base="$FTP_BASE/$reponame/$FTP_OS_SUFFIX"
for arch in ${ARCHES[@]}; do
@@ -93,7 +95,7 @@ for arch in ${ARCHES[@]}; do
for mf in $missfiles; do
if [ -e "${ftppath_base}/any/${mf}" ]; then
echo "Restoring missing 'any' symlink: ${mf}"
- ln -s "../any/${mf}" "${ftppath}"
+ ${CLEANUP_DRYRUN} || ln -s "../any/${mf}" "${ftppath}"
else
MISSINGFILES="${MISSINGFILES} ${mf}"
fi
@@ -141,17 +143,17 @@ for arch in ${ARCHES[@]}; do
fi
if [ -n "${DELETEFILES}" ]; then
- mv ${DELETEFILES} "$dest"
+ ${CLEANUP_DRYRUN} || mv ${DELETEFILES} "$dest"
echo ""
fi
if [ -n "${DELETESYMLINKS}" ]; then
- rm -f ${DELETESYMLINKS}
+ ${CLEANUP_DRYRUN} || rm -f ${DELETESYMLINKS}
echo ""
fi
if [ -n "${EXTRAFILES}" ]; then
- mv ${EXTRAFILES} "$dest"
+ ${CLEANUP_DRYRUN} || mv ${EXTRAFILES} "$dest"
echo ""
fi
@@ -189,6 +191,6 @@ fi
if [ -d "$ftppath_base/any" -a -n "${ARCHINDEPFILES}" ]; then
cd "$ftppath_base/any"
- mv ${ARCHINDEPFILES} "$dest"
+ ${CLEANUP_DRYRUN} || mv ${ARCHINDEPFILES} "$dest"
echo ""
fi