#!/bin/bash type -p gsed >/dev/null && SED=gsed || SED=sed type -p greadlink > /dev/null && READLINK=greadlink || READLINK=readlink source_url=$(LC_ALL=C svn info $(dirname $($READLINK -f $0))/../.. | $SED -n 's/^URL: \(.*\)\/src$/\1/p' 2>/dev/null) if [ -n "$source_url" ] then source_branch=${source_url##*/} source_url=${source_url%/*} source_version=${source_url##*/} case $source_version in feature|security) source_branch=$source_version/$source_branch source_url=${source_url%/*} source_version=${source_url##*/} ;; esac fi