#!/bin/bash # # svnemboss.sh - helper app for subversion vendor trees # Copyright (C) 2007 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. if [ ! -d "$1" -o ! -d "$2/.svn" ]; then echo "" >&2 echo "Usage: $0 MASTER-PATH WC-PATH" >&2 echo "" >&2 echo "Make all neccessary modifications in the working copy WC-PATH" >&2 echo "to make it identical with MASTER-PATH. This is e.g. useful for" >&2 echo "updating vendor trees:" >&2 echo "" >&2 echo " tar xjf linux-2.6.21.5.tar.bz2" >&2 echo " svn co http://my.example.org/repository/vendor/linux-2.6.21.4 linux-wc" >&2 echo "" >&2 echo " $0 linux-2.6.21.5 linux-wc" >&2 echo " svn cp linux-wc http://my.example.org/repository/vendor/linux-2.6.21.5" >&2 echo "" >&2 exit 1 fi set -e master="$1" target="$2" echo "Synchronizing..." rsync -rltD --delete --itemize-changes --exclude .svn --exclude .git "$master/." "$target/." echo "Issuing SVN ADD commands..." svn st "$2" | grep '^?' | cut -c8- | sed 's,^ *,,' | xargs -r -d '\n' svn add echo "Issuing SVN DEL commands..." svn st "$2" | grep '^!' | cut -c8- | sed 's,^ *,,' | xargs -r -d '\n' svn del echo "READY."