libretro-buildbot-recipe.sh: Switch repos for new urls.

If the current remote url is different from the new url in the recipe
it will now remove the old repo and clone the new url before building.
This commit is contained in:
orbea 2019-04-30 21:12:08 -07:00
parent 38d05a1e32
commit fb910708bc

View File

@ -612,7 +612,14 @@ while read line; do
{ echo "git directory broken, removing $DIR and skipping $NAME."; \ { echo "git directory broken, removing $DIR and skipping $NAME."; \
rm -rfv -- "$DIR" && continue; } rm -rfv -- "$DIR" && continue; }
if [ -z "${NOCLEAN}" ]; then OLDURL="$(git --work-tree="$DIR" --git-dir="$DIR/.git" config --get remote.origin.url)"
if [ "$URL" != "$OLDURL" ]; then
rm -rvf -- "$DIR"
echo "cloning repo $URL..."
git clone --depth=1 -b "$GIT_BRANCH" "$URL" "$DIR"
BUILD="YES"
elif [ -z "${NOCLEAN}" ]; then
echo "fetching changes from repo $URL..." echo "fetching changes from repo $URL..."
git --work-tree="$DIR" --git-dir="$DIR/.git" fetch --depth 1 origin "${GIT_BRANCH}" git --work-tree="$DIR" --git-dir="$DIR/.git" fetch --depth 1 origin "${GIT_BRANCH}"