libretro-buildbot-recipe.sh: Don't rely on the UPDATE variable.

This commit is contained in:
orbea 2017-12-22 13:11:25 -08:00
parent f6fd214617
commit e6e194a82d

View File

@ -594,20 +594,32 @@ while read line; do
echo
BUILD="NO"
UPDATE="YES"
if [ ! -d "${DIR}/.git" ] || [ "${CLEANUP}" = "YES" ]; then
rm -rfv -- "$DIR"
echo "cloning repo $URL..."
git clone --depth=1 -b "$GIT_BRANCH" "$URL" "$DIR"
BUILD="YES"
UPDATE="NO"
else
if [ -f "$DIR/.forcebuild" ]; then
echo "found $DIR/.forcebuild file, building $NAME"
BUILD="YES"
fi
HEAD="$(git --work-tree="$DIR" --git-dir="$DIR/.git" rev-parse HEAD)" || \
{ echo 'git directory broken, removing $NAME and skipping.'; \
{ echo "git directory broken, removing $DIR and skipping $NAME."; \
rm -rfv -- "$DIR" && continue; }
echo "pulling changes from repo $URL..."
git --work-tree="$DIR" --git-dir="$DIR/.git" pull
if [ "$HEAD" = "$(git --work-tree="$DIR" --git-dir="$DIR/.git" rev-parse HEAD)" ] && [ "${BUILD}" != "YES" ]; then
BUILD="NO"
else
echo "resetting repo state $URL..."
git --work-tree="$DIR" --git-dir="$DIR/.git" reset --hard FETCH_HEAD
git --work-tree="$DIR" --git-dir="$DIR/.git" clean -xdf
BUILD="YES"
fi
fi
cd "$DIR" || { echo "Failed to cd to ${DIR}, skipping ${NAME}"; continue; }
@ -621,23 +633,6 @@ while read line; do
git checkout "${GIT_BRANCH}"
git branch -D "${CURRENT_BRANCH}"
BUILD="YES"
UPDATE="NO"
fi
if [ "${UPDATE}" != "NO" ]; then
if [ -f .forcebuild ]; then
echo "found .forcebuild file, building $NAME"
BUILD="YES"
fi
if [ "$HEAD" = "$(git rev-parse HEAD)" ] && [ "${BUILD}" != "YES" ]; then
BUILD="NO"
else
echo "resetting repo state $URL..."
git reset --hard FETCH_HEAD
git clean -xdf
BUILD="YES"
fi
fi
FORCE_ORIG=$FORCE