WinGit: fix location of git-completion.bash
[msysgit.git] / share / WinGit / release.sh
blobc25f500404950a40e9303fc01871457c1ae3e8f8
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 cp create-shortcut.exe "$TMPDIR") &&
19 cp /share/resources/git.ico "$TMPDIR" &&
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],gp[a-fh-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/WinGit/install.tcl ./ &&
36 : > "$LIST7" &&
37 find * -type f | sed "s|^\./||" > "$LIST7" &&
38 7z a $OPTS7 $TARGET7 @"$LIST7" ||
39 exit
41 (cat /share/7-Zip/7zSD.sfx &&
42 echo ';!@Install@!UTF-8!' &&
43 echo 'Progress="yes"' &&
44 echo 'Directory="%%T\bin"' &&
45 echo 'RunProgram="wish.exe %%T\install.tcl %%T"' &&
46 echo ';!@InstallEnd@!7z' &&
47 cat $TARGET7) > "$TARGET"
48 exit