-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
__MakeSourceDistribution.sh.command
executable file
·58 lines (48 loc) · 1.12 KB
/
__MakeSourceDistribution.sh.command
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
# __MakeSourceDistribution.sh.command
#
# Creates a tarball with all necessary files to build MacTerm.
#
# Kevin Grant ([email protected])
# June 17, 2004
die () {
[ "x$1" != "x" ] && echo "$0: $1" >&2
exit 1
}
trap die ERR
# config
date=/bin/date
dirname=/usr/bin/dirname
git=git
root=~/Desktop # where the tarball goes
$date "+Started creating source tarball at %T."
# this must run from the top level of the trunk
BIN=`$dirname $0`
cd ${BIN}
# find the current version
version_parts=`Build/VersionInfo.sh`
if [ "x${version_parts}" = "x" ] ; then
echo "$0: version lookup failed" > /dev/stderr
exit 1
fi
i=0
for PART in $version_parts ; do
version_array[$i]=${PART}
i=1+$i
done
maj=${version_array[0]}
min=${version_array[1]}
sub=${version_array[2]}
alb=${version_array[3]}
bld=${version_array[4]}
if [ "x$sub" = "x0" ] ; then
sub=
elif [ "x$sub" != "x" ] ; then
sub=.${sub}
fi
version=${maj}.${min}${sub}${alb}${bld}
directory=sourceMacTerm${version}
target=$root/${directory}.tar.gz
# create archive
$git archive --format=tar.gz --prefix="$directory/" main > "$target"
$date "+Finished creating source tarball at %T."