From bb5af95ff14d35d795c7055f843ea40fbb448993 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Gonzalez Date: Fri, 6 Oct 2006 08:25:43 +0000 Subject: [PATCH] Don't check for changed files if user doesn't want to git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@453525 13f79535-47bb-0310-9956-ffa450edef68 --- maven-meeper/src/bin/m2-sync/m2-sync.sh | 39 ++++++++++++++++--------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/maven-meeper/src/bin/m2-sync/m2-sync.sh b/maven-meeper/src/bin/m2-sync/m2-sync.sh index 5f64e753c..7bbd43284 100755 --- a/maven-meeper/src/bin/m2-sync/m2-sync.sh +++ b/maven-meeper/src/bin/m2-sync/m2-sync.sh @@ -6,6 +6,12 @@ echo This will be removed when the repository manager is in place. echo +echo Options +echo go - does the sync for real +echo check - checks for changed files + +echo + echo echo For a better explanation of the output flags please check --itemize-changes at rsync man page echo @@ -38,20 +44,27 @@ for f in `find conf -iname "*.sh"` RSYNC_SSH="--rsh=ssh $SSH_OPTS" fi - echo "Syncing $FROM -> $TO" - rsync --include=*/ --include=**/maven-metadata.xml* --exclude=* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO - rsync --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --ignore-existing $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO - # check for changed files - rsync -n --exclude=**/maven-metadata.xml* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --existing $RSYNC_OPTS -Lrtivzc "$RSYNC_SSH" $FROM $BASEDIR/$TO >> $CHANGED_LOG + if [ "$1" == "check" ]; then + + rsync -n --exclude=**/maven-metadata.xml* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --existing $RSYNC_OPTS -Lrtivzc "$RSYNC_SSH" $FROM $BASEDIR/$TO >> $CHANGED_LOG + + else + + echo "Syncing $FROM -> $TO" + rsync --include=*/ --include=**/maven-metadata.xml* --exclude=* --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO + rsync --exclude-from=$HOME/components/maven-meeper/src/bin/syncopate/exclusions.txt --ignore-existing $RSYNC_OPTS -Lrtivz "$RSYNC_SSH" $FROM $BASEDIR/$TO + + fi done -echo "*******************************************************************************" -echo "******************************* CHANGED FILES *******************************" -echo "*******************************************************************************" -cat $CHANGED_LOG -echo "*******************************************************************************" -echo "*******************************************************************************" -echo "*******************************************************************************" - +if [ "$1" == "check" ]; then + echo "*******************************************************************************" + echo "******************************* CHANGED FILES *******************************" + echo "*******************************************************************************" + cat $CHANGED_LOG + echo "*******************************************************************************" + echo "*******************************************************************************" + echo "*******************************************************************************" +fi