WinGit: do not pack builtins, but copy them when unpacking
[msysgit.git] / share / WinGit / release.sh
blobe386a9045cab634c192761498cc41c904188810e
1 #!/bin/sh
3 test -z "$1" && {
4 echo "Usage: $0 <version>"
5 exit 1
8 TARGET="$HOME"/WinGit-$1.exe
9 OPTS7="-m0=lzma -mx=9 -md=64M"
10 TARGET7=tmp.7z
11 LIST7=fileList.txt
12 TMPDIR=/tmp/WinGit
14 (test ! -d "$TMPDIR" || echo "Removing $TMPDIR" && rm -rf "$TMPDIR") &&
15 mkdir "$TMPDIR" &&
16 cd "$TMPDIR" &&
17 echo "Copying files" &&
18 (cd / && tar cf - bin/ lib/perl5/) |
19 tar xvf - &&
20 gitmd5=$(md5sum bin/git.exe | cut -c 1-32) &&
21 md5sum bin/git-*.exe | sed -n "s/^$gitmd5 \\*//p" > fileList-builtins.txt &&
22 rm $(cat fileList-builtins.txt) &&
23 (cd /mingw && tar cf - bin/*{tcl,tk,wish,gpg,curl.exe}* \
24 lib/*{tcl,tk}* libexec/gnupg/) |
25 tar xvf - &&
26 strip bin/{[a-fh-z],g[a-oq-z],gp[a-fh-z]}*.exe &&
27 mkdir etc &&
28 cp /etc/profile etc/ &&
29 cp /share/WinGit/install.tcl ./ &&
30 : > "$LIST7" &&
31 find * -type f | sed "s|^\./||" > "$LIST7" &&
32 7z a $OPTS7 $TARGET7 @"$LIST7" ||
33 exit
35 (cat /share/7-Zip/7zSD.sfx &&
36 echo ';!@Install@!UTF-8!' &&
37 echo 'Progress="yes"' &&
38 echo 'Directory="%%T\bin"' &&
39 echo 'RunProgram="wish.exe %%T\install.tcl %%T"' &&
40 echo ';!@InstallEnd@!7z' &&
41 cat $TARGET7) > "$TARGET"
42 exit