diff options
Diffstat (limited to 'scripts/auto-build')
-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 |