diff --git a/buildcore.sh b/buildcore.sh index a0ae1169a..b6535127e 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -189,6 +189,22 @@ fi SOMETHINGCHANGED=0 if [ "$GIT" = "1" ]; then # using git + + # Do some error checking for the build before starting... + # check if there's any modifications to git current repo + MODIFIED_FILES=`git ls-files --modified | tr '\n' ', '` + if [ $MODIFIED_FILES ]; then + echo "The following files have been modified in the local repository: $MODIFIED_FILES..." + echo "Not a clean build, aborting..." + exit 3 + fi + # check if there's any modifications to git current repo + UNTRACKED_FILES=`git ls-files --others | tr '\n' ', '` + if [ -n $UNTRACKED_FILES ]; then + echo "The following files are not tracked in git: $UNTRACKED_FILES..." + echo "Not a clean build, aborting..." + exit 3 + fi if [ -z "$GITUP" ]; then GITUP=../coregitup echo "git pull > $GITUP" diff --git a/makerpm b/makerpm index fba98fc4c..14a4d7c02 100755 --- a/makerpm +++ b/makerpm @@ -45,6 +45,11 @@ function makenoarch { rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz RC=$? + + if [ $RPMNAME = "xCAT-UI" ]; then + # undo the modifications above to leave the sandbox prestine on the build machine + git checkout xCAT-UI/xCAT-UI.spec + fi fi }