WinGit: fix location of git-completion.bash
[git/jnareb-git.git] / share / WinGit / release.sh
blob8dbf1cbf94f896a1a078d624849838abb623179f
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 "$(dirname "$0")" &&
17 make &&
18 mkdir "$TMPDIR"/bin &&
19 cp create-shortcut.exe "$TMPDIR"/bin) &&
20 cd "$TMPDIR" &&
21 echo "Copying files" &&
22 (cd / && tar cf - bin/ lib/perl5/) |
23 tar xvf - &&
24 gitmd5=$(md5sum bin/git.exe | cut -c 1-32) &&
25 md5sum bin/git-*.exe | sed -n "s/^$gitmd5 \\*//p" > fileList-builtins.txt &&
26 rm $(cat fileList-builtins.txt) &&
27 (cd /mingw && tar cf - bin/*{tcl,tk,wish,gpg,curl.exe}* \
28 lib/*{tcl,tk}* libexec/gnupg/) |
29 tar xvf - &&
30 strip bin/{[a-fh-z],g[a-oq-z]}*.exe &&
31 mkdir etc &&
32 cp /git/contrib/completion/git-completion.bash etc/ &&
33 sed 's/^\. .*\(git-completion.bash\)/. \/etc\/\1/' \
34 < /etc/profile > etc/profile &&
35 cp /share/resources/git.ico etc/ &&
36 cp /share/WinGit/install.tcl ./ &&
37 : > "$LIST7" &&
38 find * -type f | sed "s|^\./||" > "$LIST7" &&
39 7z a $OPTS7 $TARGET7 @"$LIST7" ||
40 exit
42 (cat /share/7-Zip/7zSD.sfx &&
43 echo ';!@Install@!UTF-8!' &&
44 echo 'Progress="yes"' &&
45 echo 'Directory="%%T\bin"' &&
46 echo 'RunProgram="wish.exe %%T\install.tcl %%T"' &&
47 echo ';!@InstallEnd@!7z' &&
48 cat $TARGET7) > "$TARGET"
49 exit