2012-06-15 18:22:00 +00:00
|
|
|
#!/bin/sh
|
2012-06-15 18:14:50 +00:00
|
|
|
#
|
|
|
|
# Workaround for `cabal sdist` requiring all included files to be listed
|
|
|
|
# in .cabal.
|
2012-06-12 09:36:05 +00:00
|
|
|
|
|
|
|
# Create target directory
|
2012-06-12 09:45:53 +00:00
|
|
|
sdist_dir=git-annex-$(grep '^Version:' git-annex.cabal | sed -re 's/Version: *//')
|
|
|
|
mkdir --parents dist/$sdist_dir
|
2012-06-12 09:36:05 +00:00
|
|
|
|
|
|
|
find . \( -name .git -or -name dist -or -name cabal-dev \) -prune \
|
|
|
|
-or -not -name \\*.orig -not -type d -print \
|
2014-04-11 22:45:46 +00:00
|
|
|
| perl -ne "print unless length >= 100 - length q{$sdist_dir}" \
|
|
|
|
| grep -v ':' \
|
|
|
|
| xargs cp --parents --target-directory dist/$sdist_dir
|
2012-06-12 09:36:05 +00:00
|
|
|
|
|
|
|
cd dist
|
2014-04-11 22:45:46 +00:00
|
|
|
tar --format=ustar -caf $sdist_dir.tar.gz $sdist_dir
|
2012-06-15 18:14:50 +00:00
|
|
|
|
|
|
|
# Check that tarball can be unpacked by cabal.
|
|
|
|
# It's picky about tar longlinks etc.
|
|
|
|
rm -rf $sdist_dir
|
|
|
|
cabal unpack $sdist_dir.tar.gz
|