mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-21 19:22:05 +00:00
Check for uncommitted and modified files in the git repository before
running the build and abort if the build repo is not clean Add a check for xCAT-UI to undo the sed that is done during the build to leave the build repo clean
This commit is contained in:
parent
e63a398bfc
commit
f3bfa70f94
16
buildcore.sh
16
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"
|
||||
|
5
makerpm
5
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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user