Rawhide snapshot updates

- Check for trying to snapshot a git tag
- Check for nothing to do case
- Switch to using git -C in one place instead of a pushd
This commit is contained in:
Laura Abbott 2016-10-17 11:53:27 -07:00
parent 1b957b6a4f
commit 1fdea39f75

View File

@ -23,13 +23,24 @@ if [ ! -d "$LINUX_GIT" ]; then
exit 1 exit 1
fi fi
pushd $LINUX_GIT git -C $LINUX_GIT pull
git pull
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
echo "Git pull failed. Is your tree clean/correct?" echo "Git pull failed. Is your tree clean/correct?"
exit 1 exit 1
fi fi
popd
git -C $LINUX_GIT describe --tags HEAD | grep -q "\-g"
if [ ! $? -eq 0 ]; then
echo "Trying to snapshot off of a tagged git."
echo "I don't think this is what you want"
exit 1
fi
if [ "$(git -C $LINUX_GIT rev-parse origin/master)" == `cat gitrev` ]; then
echo "Last snapshot commit matches current master. Nothing to do"
echo "\o/"
exit 0
fi
GIT=`grep "%define gitrev" kernel.spec | cut -d ' ' -f 3` GIT=`grep "%define gitrev" kernel.spec | cut -d ' ' -f 3`
if [ "$GIT" -eq 0 ]; then if [ "$GIT" -eq 0 ]; then