commit ffe2b347824482d183cdf10f2e533ce72e752889 parent 4c77e4ea8724e8b563f9e6ae22c1b0a106f9fd68 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Thu, 27 Aug 2020 11:23:43 +0200 add blacklist mechanism Diffstat:
svnsync-myrepos | | | 28 | +++++++++++++++++----------- |
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/svnsync-myrepos b/svnsync-myrepos @@ -7,20 +7,26 @@ set -e DEST=$(realpath "$1") +BLACKLIST="$HOME/config/private/svnrepos_excluded" +touch "$BLACKLIST" ls ~/svn | while read repos do - cd "$HOME/svn/$repos" - URL=$(svn info | grep '^URL:' | cut -d' ' -f2) - cd "$DEST" - LDEST="file://$DEST/$repos" - if [ ! -d "$DEST/$repos" ] + # exclude repositories in $BLACKLIST + if ! grep "^$repos\$" "$BLACKLIST" > /dev/null then - # https://stackoverflow.com/a/2303862 - svnadmin create "$repos" - echo -ne '#!/bin/sh\nexit 0' > "$repos/hooks/pre-revprop-change" - chmod ugo+x "./$repos/hooks/pre-revprop-change" - svnsync init "$LDEST" "$URL" + cd "$HOME/svn/$repos" + URL=$(svn info | grep '^URL:' | cut -d' ' -f2) + cd "$DEST" + LDEST="file://$DEST/$repos" + if [ ! -d "$DEST/$repos" ] + then + # https://stackoverflow.com/a/2303862 + svnadmin create "$repos" + echo -ne '#!/bin/sh\nexit 0' > "$repos/hooks/pre-revprop-change" + chmod ugo+x "./$repos/hooks/pre-revprop-change" + svnsync init "$LDEST" "$URL" + fi + svnsync sync "$LDEST" fi - svnsync sync "$LDEST" done