File: mktarball

package info (click to toggle)
arping 2.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,084 kB
  • sloc: sh: 4,691; ansic: 3,894; exp: 405; python: 142; makefile: 34
file content (42 lines) | stat: -rwxr-xr-x 689 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

set -e

VERSION="$1"

if [ x"$VERSION" = x"" ]; then
    echo "Usage: $0 <version>"
    echo
    echo "  Example:   $0 arping-2.11"
    exit 1
fi

if [ x"$VERSION" = x"latest" ]; then
    VERSION="$(git tag | tail -1)"
fi

if [ x"$VERSION" = x"HEAD" ]; then
    VERSION="$(git describe)"
fi

OUTPUT="$VERSION.tar.gz"
echo "Writing $OUTPUT"

GITDIR="$(realpath .)"
TMPDIR="$(mktemp -d)"

(
    cd "$TMPDIR"
    mkdir "$VERSION"
    cd "$VERSION"
    git init
    git fetch "$GITDIR"
    git fetch --tags "$GITDIR"
    git checkout "$VERSION"
    rm -fr .git
    autoreconf -i
    rm -fr autom4te.cache
    cd ..
    tar cfz - "$VERSION" > "$GITDIR/$OUTPUT"
)
rm -fr -- "$TMPDIR"