From 1fdea39f75096d3deccd1c9e900e1830dbdef512 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 17 Oct 2016 11:53:27 -0700 Subject: [PATCH] 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 --- scripts/rawhide-snapshot.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/rawhide-snapshot.sh b/scripts/rawhide-snapshot.sh index ac9bfc771..b96bd38d9 100755 --- a/scripts/rawhide-snapshot.sh +++ b/scripts/rawhide-snapshot.sh @@ -23,13 +23,24 @@ if [ ! -d "$LINUX_GIT" ]; then exit 1 fi -pushd $LINUX_GIT -git pull +git -C $LINUX_GIT pull if [ ! $? -eq 0 ]; then echo "Git pull failed. Is your tree clean/correct?" exit 1 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` if [ "$GIT" -eq 0 ]; then