[Piuparts-commits] [piuparts] 01/01: prepare_backup: refactor
Holger Levsen
holger at moszumanska.debian.org
Tue May 20 12:22:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit c9cb9bf46755af06fd3da4d8368a81733ef5fcde
Author: Holger Levsen <holger at layer-acht.org>
Date: Tue May 20 14:20:08 2014 +0200
prepare_backup: refactor
---
master-bin/prepare_backup.in | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/master-bin/prepare_backup.in b/master-bin/prepare_backup.in
index f9124c3..b440ef9 100755
--- a/master-bin/prepare_backup.in
+++ b/master-bin/prepare_backup.in
@@ -35,20 +35,19 @@ get_config_value HTDOCS global output-directory
get_config_value BACKUPDIR global backup-directory ''
+copy_to_backupdir() {
+ if [ -f $MASTER/$1 ]; then
+ cp $MASTER/$1 $BACKUPDIR/$1
+ fi
+}
+
test -n "$BACKUPDIR" || exit 0
-if [ -f $MASTER/bts_stats.txt ]; then
- cp $MASTER/bts_stats.txt $BACKUPDIR/
-fi
+copy_to_backupdir bts_stats.txt
for SECTION in $SECTIONS ; do
mkdir -p $BACKUPDIR/$SECTION
- if [ -f $MASTER/$SECTION/submissions.txt ]; then
- cp $MASTER/$SECTION/submissions.txt $BACKUPDIR/$SECTION/
- fi
+ copy_to_backupdir $SECTION/submissions.txt
if [ -f $HTDOCS/$SECTION/counts.txt ]; then
cp $HTDOCS/$SECTION/counts.txt $BACKUPDIR/$SECTION/
fi
- if [ -f $MASTER/bts_stats.txt ]; then
- cp $MASTER/bts_stats.txt $BACKUPDIR/
- fi
done
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list