test-rebuild.sh: fix the branch handling

no longer hardcode master branch version
This commit is contained in:
Jens Petersen 2017-05-10 11:15:55 +09:00
parent 445740902c
commit d6e0ba914f
1 changed files with 8 additions and 5 deletions

View File

@ -23,11 +23,14 @@ ARCH=$(arch)
if [ -f /etc/os-release ]; then
eval $(grep VERSION_ID /etc/os-release)
case $VERSION_ID in
26) BRANCH=master ;;
7.*) BRANCH=epel7 ;;
*) BRANCH="f$VERSION_ID" ;;
esac
if git branch -a | grep -q f$VERSION_ID; then
BRANCH=f$VERSION_ID
else
case $VERSION_ID in
7.*) BRANCH=epel7 ;;
*) BRANCH=master ;;
esac
fi
else
# assume RHEL6
BRANCH=el6