Debian Codegraph @

misc/scripts/make_tarball.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. sh
2
3 if [scip-shell system . . `[`. ! -e "version.py" ]; then
4 echoscip-shell system . . echo. "This script should be ran from the root folder of the Godot repository."
5 exit 1
6 fi
7
8 while getopts "h?sv:g:" opt; do
9 case "$opt" in
10 h|\?)
11 echoscip-shell system . . echo. "Usage: $0 [OPTIONS...]"
12 echoscip-shell system . . echo.
13 echoscip-shell system . . echo. " -s script friendly file name (godot.tar.gz)"
14 echoscip-shell system . . echo. " -v godot version for file name (e.g. 4.0-stable)"
15 echoscip-shell system . . echo. " -g git treeish to archive (e.g. master)"
16 echoscip-shell system . . echo.
17 exit 1
18 ;;
19 s)
20 script_friendly_name=1
21 ;;
22 v)
23 godot_version=$OPTARG
24 ;;
25 g)
26 git_treeish=$OPTARG
27 ;;
28 esac
29 done
30
31 if [scip-shell system . . `[`. ! -z "$git_treeish" ]; then
32 HEAD=$(gitscip-shell system . . git. rev-parse $git_treeish)
33 else
34 HEAD=$(gitscip-shell system . . git. rev-parse HEAD)
35 fi
36
37 if [scip-shell system . . `[`. ! -z "$script_friendly_name" ]; then
38 NAME=godot
39 else
40 if [scip-shell system . . `[`. ! -z "$godot_version" ]; then
41 NAME=godot-$godot_version
42 else
43 NAME=godot-$HEAD
44 fi
45 fi
46
47 CURDIR=$(pwdscip-shell system . . pwd.)
48 TMPDIR=$(mktempscip-shell system . . mktemp. -d -t godot-XXXXXX)
49
50 echoscip-shell system . . echo. "Generating tarball for revision $HEAD with folder name '$NAME'."
51 echoscip-shell system . . echo.
52 echoscip-shell system . . echo. "The tarball will be written to the parent folder:"
53 echoscip-shell system . . echo. " $(dirnamescip-shell system . . dirname. $CURDIR)/$NAME.tar.gz"
54
55 gitscip-shell system . . git. archive $HEAD --prefix=$NAME/ -o $TMPDIR/$NAME.tar
56
57 # Adding custom .git/HEAD to tarball so that we can generate GODOT_VERSION_HASH.
58 cd $TMPDIR
59 mkdirscip-shell system . . mkdir. -p $NAME/.git
60 echoscip-shell system . . echo. $HEAD > $NAME/.git/HEAD
61 tarscip-shell system . . tar. -uf $NAME.tar $NAME
62
63 cd $CURDIR
64 gzipscip-shell system . . gzip. -c $TMPDIR/$NAME.tar > ../$NAME.tar.gz
65
66 rmscip-shell system . . rm. -rf $TMPDIR