diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-09-11 16:47:48 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-09-11 16:47:48 +0000 |
commit | 4d6d0e5f7c79543c9c848e5aad86a5c2e20ff48c (patch) | |
tree | 71dc888250ca882b8b4300f1c8c8bb59e8385db7 /scripts/auto-build/auto-build-common | |
parent | dd99d3bc8678637e1aa5ccab512d4d75869bf8ae (diff) |
Mac OS X's included git or svn might be really old, so try Fink first
svn path=/trunk/; revision=16232
Diffstat (limited to 'scripts/auto-build/auto-build-common')
-rw-r--r-- | scripts/auto-build/auto-build-common | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/scripts/auto-build/auto-build-common b/scripts/auto-build/auto-build-common index 39310786..5a522aff 100644 --- a/scripts/auto-build/auto-build-common +++ b/scripts/auto-build/auto-build-common @@ -79,21 +79,46 @@ rsync_distro() esac } +# Mac OS X's included git or svn might be really old, so try Fink first +find_git() +{ + if [ -x /sw/bin/git ]; then + echo /sw/bin/git + elif [ -x /usr/bin/git ]; then + echo /usr/bin/git + else + echo git + fi +} + +find_svn() +{ + if [ -x /sw/bin/svn ]; then + echo /sw/bin/svn + elif [ -x /usr/bin/svn ]; then + echo /usr/bin/svn + else + echo svn + fi +} + clean_and_update_folder() { folder=$1 cd $folder if [ -d $folder/.git ]; then - git reset --hard - git clean -fdx - git pull + git=$(find_git) + $git reset --hard + $git clean -fdx + $git pull elif [ -d $folder/.svn ]; then - svn revert -R . - svn status --no-ignore | \ + svn=$(find_svn) + $svn revert -R . + $svn status --no-ignore | \ grep -v '^X' | \ awk '{print $2}' | \ xargs rm -rf - svn update + $svn update else echo "no cleaning done, unknown SCM" fi |