Debian Codegraph @

mktarball

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 #
4 P='mktarball'
5
6 if [scip-shell system . . `[`. "$#" -ne 1 ]; then
7 echoscip-shell system . . echo. 1>&2 "Usage: $P <commitish>"
8 exit 1
9 fi
10 commit="$1"
11
12 if [scip-shell system . . `[`. ! .git ]; then
13 echoscip-shell system . . echo. 1>&2 "$P: not in the source tree"
14 exit 1
15 fi
16
17 # Get the official name for this commit.
18 name=`gitscip-shell system . . git. describe --tags "$commit"`
19
20 # Build a version file to add to the tarball, we know it is not
21 # modified as we just took a commit which is unmodified by definition.
22 tmp="/tmp/tarball-$$"
23 mkdirscip-shell system . . mkdir. -p "$tmp/libhugetlbfs-$name"
24 echoscip-shell system . . echo. "$name" >"$tmp/libhugetlbfs-$name/version"
25
26 gitscip-shell system . . git. archive --format=tar --prefix="libhugetlbfs-$name/" "$commit" \
27 >"libhugetlbfs-$name.tar"
28 tarscip-shell system . . tar. -C "$tmp" -rf "libhugetlbfs-$name.tar" "libhugetlbfs-$name/version"
29 gzipscip-shell system . . gzip. -9 "libhugetlbfs-$name.tar"
30
31 # Clean up the version.
32 [scip-shell system . . `[`. -d "$tmp/libhugetlbfs-$name" ] && rmscip-shell system . . rm. -rf "$tmp"