3 # Repack the boost tarball as xz (much faster to unpack) and remove
4 # a lot of needless files such as generated html docs.
8 if test -z "$tarball" -o ! -f "$tarball"; then
9 echo "Usage: $0 <tarball>"
15 if ! test -d "$tmpdir"; then
20 echo Unpacking
"$tarball" ...
21 tar x
-C "$tmpdir" -f "$tarball"
22 if test $?
-ne 0; then
28 echo Removing unnecessary files ...
29 find "$tmpdir" \
( -name doc
-o -name test -o -name example \
) -type d
-prune -print0 |
xargs -0 rm -r
30 if test $?
-ne 0; then
31 echo file removal failed
36 name
="$(basename "$tarball" | sed 's/\.tar.*$//').tar.xz"
39 echo Creating
"$name" ...
40 # To make the tarball reproducible, use a timestamp of a file inside the tarball (they all seem to have the same mtime).
41 if ! test -f "$tmpdir/$dir/README.md"; then
42 echo timestamp retrieval failed
, check the
script
46 # Many of the options are to make the tarball reproducible.
47 LC_ALL
=C
tar c
-C "$tmpdir" --xz -f "$(pwd)/$name" --format=gnu
--sort=name
--owner=0 --group=0 --mode=go
=rX
,u
=rwX
--mtime "$tmpdir/$dir/README.md" "$dir"
48 if test $?
-ne 0; then