test-rebuild.sh: check branch agrees with installation

This commit is contained in:
Jens Petersen 2013-11-20 19:44:54 +09:00
parent 4d2eb25803
commit 0b2f17698e
1 changed files with 9 additions and 0 deletions

View File

@ -21,10 +21,19 @@ ARCH=$(arch)
# exit 1
#fi
eval $(grep VERSION_ID /etc/os-release)
BRANCH="f$VERSION_ID"
# maybe use BRANCH here too?
if [ -n "$2" ]; then
fedpkg switch-branch $2
fi
if [ "* $BRANCH" != "$(git branch --list $BRANCH" ]; then
echo "Git branch does not match Fedora installation!"
exit 1
fi
sudo yum-builddep $PKG.spec
fedpkg local