]> source.dussan.org Git - archiva.git/commitdiff
Don't check for changed files if user doesn't want to
authorCarlos Sanchez Gonzalez <carlos@apache.org>
Fri, 6 Oct 2006 08:25:43 +0000 (08:25 +0000)
committerCarlos Sanchez Gonzalez <carlos@apache.org>
Fri, 6 Oct 2006 08:25:43 +0000 (08:25 +0000)
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

index 5f64e753c3b8a4e4719cdb3d82e4b004356e662b..7bbd432841be220f8d7dab3b656c7c78654c625b 100755 (executable)
@@ -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
 
-done
+    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 "*******************************************************************************"
-echo "*******************************  CHANGED FILES  *******************************"
-echo "*******************************************************************************"
-cat $CHANGED_LOG
-echo "*******************************************************************************"
-echo "*******************************************************************************"
-echo "*******************************************************************************"
+    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
+
+if [ "$1" == "check" ]; then
+  echo "*******************************************************************************"
+  echo "*******************************  CHANGED FILES  *******************************"
+  echo "*******************************************************************************"
+  cat $CHANGED_LOG
+  echo "*******************************************************************************"
+  echo "*******************************************************************************"
+  echo "*******************************************************************************"
+fi