Permalink
Browse files

build-release-tarball: Stop using .gitattributes.

Unfortunately, GitHub's web UI for generating release tarballs uses
`.gitattributes` to control what files to download, and thus if you
downloaded a source tarball for older Zulip versions using the GitHub
web UI, you'd be missing important files.

We fix this for future releases by moving the blacklist out of
.gitattributes.

Fixes #129.
  • Loading branch information...
timabbott committed Oct 12, 2017
1 parent e749deb commit bfaf0fb3b2c3ece777bbad32f736bb7c1b6c90e8
Showing with 28 additions and 21 deletions.
  1. +0 −14 .gitattributes
  2. +13 −7 tools/build-release-tarball
  3. +15 −0 tools/release-tarball-exclude.txt
View
@@ -9,17 +9,3 @@
*.png binary
*.otf binary
*.tif binary
.gitignore export-ignore
.gitattributes export-ignore
/static/assets export-ignore
/corporate export-ignore
/static export-ignore
/tools export-ignore
/zilencer export-ignore
/templates/corporate export-ignore
/templates/zilencer export-ignore
/puppet/zulip_internal export-ignore
/zproject/test_settings.py export-ignore
/zerver/fixtures export-ignore
/zerver/tests export-ignore
/frontend_tests export-ignore
@@ -41,23 +41,29 @@ if ! git diff --exit-code >/dev/null; then
exit 1
fi
TMP_CHECKOUT=$TMPDIR/$prefix/
TMP_CHECKOUT=$TMPDIR/$prefix
TARBALL=$TMPDIR/$prefix.tar
BASEDIR=$(pwd)
# .gitattributes lists the files that are not exported
git archive -o "$TARBALL" "--prefix=$prefix/" HEAD
cd "$TMPDIR"
tar -xf "$TARBALL"
for i in `cat "$TMP_CHECKOUT"/tools/release-tarball-exclude.txt`; do
rm -r --interactive=never "$TMP_CHECKOUT/$i";
done
tar -cf "$TARBALL" "$prefix"
rm -rf "$prefix"
if tar -tf "$TARBALL" | grep -q -e ^zerver/tests; then
echo "Excluded files remain in tarball!";
echo "Versions of git 1.8.1.1 - 1.8.1.6 have broken .gitattributes syntax";
exit 1;
else
echo "Check for excluded files passed";
echo "BUG: Excluded files remain in tarball!"
exit 1
fi
cd "$BASEDIR"
# 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 "$TMP_CHECKOUT/"
cd "$TMP_CHECKOUT"
# create var/log directory in the new temporary checkout
@@ -0,0 +1,15 @@
.gitignore
.gitattributes
static/assets
corporate/
static/
tools/
zilencer/
templates/corporate
templates/zilencer
puppet/zulip_ops
zproject/dev_settings.py
zproject/test_settings.py
zerver/fixtures
zerver/tests
frontend_tests

0 comments on commit bfaf0fb

Please sign in to comment.