mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

svn-poll-myrepos (641B)


      1 #!/bin/bash
      2 
      3 # mail about changes to all repos registered in myrepos configuration
      4 
      5 set -e
      6 
      7 LOCKDIR="$HOME/temp/lock"
      8 mkdir -p "$LOCKDIR"
      9 
     10 CONFIG="$HOME/.mrconfig"
     11 LOCK="$LOCKDIR/svn-poll-myrepos"
     12 USERS="$HOME/config/private/svnrepos"
     13 
     14 lockfile -r 0 "$LOCK" || { echo "could not acquire lock"; exit 1; }
     15 cleanupfun() {
     16   rm -f "$LOCK" || true
     17 }
     18 trap cleanupfun ERR EXIT
     19 
     20 cd
     21 grep '^\[svn/' "$CONFIG" | tr -d '[]' | while read REPO; do
     22   URL=$(svn info "$REPO" | grep '^URL' | cut -d':' -f2- | tr -d ' ')
     23   USER=$(grep "^$URL" "$USERS" | cut -d' ' -f2)
     24   #echo "$URL" "$USER"
     25   $HOME/bin/svn-poll "$URL" "$USER"
     26 done
     27 
     28 # cleanup by cleanupfun
     29