| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | VERSION="$1" |
| 6 | |
| 7 | if [scip-shell system . . `[`. x"$VERSION" = x"" ]; then |
| 8 | echoscip-shell system . . echo. "Usage: $0 <version>" |
| 9 | echoscip-shell system . . echo. |
| 10 | echoscip-shell system . . echo. " Example: $0 arping-2.11" |
| 11 | exit 1 |
| 12 | fi |
| 13 | |
| 14 | if [scip-shell system . . `[`. x"$VERSION" = x"latest" ]; then |
| 15 | VERSION="$(gitscip-shell system . . git. tag | tailscip-shell system . . tail. -1)" |
| 16 | fi |
| 17 | |
| 18 | if [scip-shell system . . `[`. x"$VERSION" = x"HEAD" ]; then |
| 19 | VERSION="$(gitscip-shell system . . git. describe)" |
| 20 | fi |
| 21 | |
| 22 | OUTPUT="$VERSION.tar.gz" |
| 23 | echoscip-shell system . . echo. "Writing $OUTPUT" |
| 24 | |
| 25 | GITDIR="$(realpathscip-shell system . . realpath. .)" |
| 26 | TMPDIR="$(mktempscip-shell system . . mktemp. -d)" |
| 27 | |
| 28 | ( |
| 29 | cd "$TMPDIR" |
| 30 | mkdirscip-shell system . . mkdir. "$VERSION" |
| 31 | cd "$VERSION" |
| 32 | gitscip-shell system . . git. init |
| 33 | gitscip-shell system . . git. fetch "$GITDIR" |
| 34 | gitscip-shell system . . git. fetch --tags "$GITDIR" |
| 35 | gitscip-shell system . . git. checkout "$VERSION" |
| 36 | rmscip-shell system . . rm. -fr .git |
| 37 | autoreconfscip-shell system . . autoreconf. -i |
| 38 | rmscip-shell system . . rm. -fr autom4te.cache |
| 39 | cd .. |
| 40 | tarscip-shell system . . tar. cfz - "$VERSION" > "$GITDIR/$OUTPUT" |
| 41 | ) |
| 42 | rmscip-shell system . . rm. -fr -- "$TMPDIR" |