build-release-tarball: Fold away the confusing variable TMP_CHECKOUT.

Even where this is actually used for a temporary checkout, it obscures
the relationship between this and $TMPDIR -- and some of our logic
depends on that.  In other places, it isn't actually even a checkout.
In all cases, the expanded version is clearer.
This commit is contained in:
Greg Price 2017-11-16 14:25:16 -08:00 committed by Tim Abbott
parent 3d1211edcf
commit 0cc8d243e4
1 changed files with 7 additions and 8 deletions

View File

@ -38,7 +38,6 @@ if ! git diff --exit-code >/dev/null; then
fi fi
TMPDIR=$(mktemp -d) TMPDIR=$(mktemp -d)
TMP_CHECKOUT=$TMPDIR/$prefix
TARBALL=$TMPDIR/$prefix.tar TARBALL=$TMPDIR/$prefix.tar
BASEDIR=$(pwd) BASEDIR=$(pwd)
@ -46,8 +45,8 @@ git archive -o "$TARBALL" "--prefix=$prefix/" HEAD
cd "$TMPDIR" cd "$TMPDIR"
tar -xf "$TARBALL" tar -xf "$TARBALL"
for i in `cat "$TMP_CHECKOUT"/tools/release-tarball-exclude.txt`; do for i in `cat "$TMPDIR/$prefix/tools/release-tarball-exclude.txt"`; do
rm -r --interactive=never "$TMP_CHECKOUT/$i"; rm -r --interactive=never "$TMPDIR/$prefix/$i";
done done
tar -cf "$TARBALL" "$prefix" tar -cf "$TARBALL" "$prefix"
rm -rf "$prefix" rm -rf "$prefix"
@ -60,8 +59,8 @@ fi
cd "$BASEDIR" cd "$BASEDIR"
# Check out a temporary full copy of the index to generate static files # Check out a temporary full copy of the index to generate static files
git checkout-index -f -a --prefix "$TMP_CHECKOUT/" git checkout-index -f -a --prefix "$TMPDIR/$prefix/"
cd "$TMP_CHECKOUT" cd "$TMPDIR/$prefix"
# create var/log directory in the new temporary checkout # create var/log directory in the new temporary checkout
mkdir -p "var/log" mkdir -p "var/log"
@ -87,14 +86,14 @@ EOF
# We do a bit of gymnastics to have update-prod-static.log be easily # We do a bit of gymnastics to have update-prod-static.log be easily
# visible to the user and end up in the same directory as the final # visible to the user and end up in the same directory as the final
# release tarball. # release tarball.
USER_PROD_STATIC_LOGPATH="${TMPDIR}/update-prod-static.log" USER_PROD_STATIC_LOGPATH="$TMPDIR/update-prod-static.log"
BUILD_PROD_STATIC_LOGPATH="${TMP_CHECKOUT}/var/log/update-prod-static.log" BUILD_PROD_STATIC_LOGPATH="$TMPDIR/$prefix/var/log/update-prod-static.log"
ln -nfs "$BUILD_PROD_STATIC_LOGPATH" "$USER_PROD_STATIC_LOGPATH" ln -nfs "$BUILD_PROD_STATIC_LOGPATH" "$USER_PROD_STATIC_LOGPATH"
./tools/update-prod-static $authors_not_required || ( ./tools/update-prod-static $authors_not_required || (
set +x set +x
echo; echo -ne "\033[33mRunning update-prod-static failed. " echo; echo -ne "\033[33mRunning update-prod-static failed. "
echo -e "Check ${TMPDIR}/update-prod-static.log for more information.\033[0m" echo -e "Check $TMPDIR/update-prod-static.log for more information.\033[0m"
exit 1 exit 1
) )
rm -f "$USER_PROD_STATIC_LOGPATH" rm -f "$USER_PROD_STATIC_LOGPATH"