22 echo "Usage: $0 [-f] [-n] <version>" >&2
28 # change directory to msysGit root
29 SCRIPTDIR
="$(cd "$
(dirname "$0")" && pwd)"
30 MSYSGITROOT
="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
32 echo "Could not change directory to msysGit root" >&2
39 echo "If that is okay, please call '$0 -f $version'" >&2
44 git update-index
--refresh &&
45 git diff-files
--quiet &&
46 git diff-index
--cached HEAD
--) ||
47 die
"Git submodule has dirty files"
48 (git update-index
--refresh &&
49 git diff-files
--quiet &&
50 git diff-index
--cached HEAD
--) ||
51 die
"msysGit super project not up-to-date"
54 create_msysgit_tag
() {
55 if tag
=$
(git describe
--exact-match --match "*.msysgit.*" HEAD
2> /dev
/null
)
57 echo "Using existing tag $tag"
60 tag
=$
(git describe HEAD | cut
-d- -f1) &&
61 tag
=${tag%.msysgit.*} &&
62 while ! git tag
-a -m "Git for Windows $1" $tag.msysgit.
$i 2> /dev
/null
66 echo "Created tag $tag.msysgit.$i"
70 # compile everything needed for standard setup
71 test "$do_compile" && {
72 wordpad
share
/WinGit
/ReleaseNotes.rtf
&& {
73 ( # create a commit if ReleaseNotes changed
74 if test ! -z "$(git diff share/WinGit/ReleaseNotes.rtf)"
76 git add
share
/WinGit
/ReleaseNotes.rtf
&&
77 git commit
-m "Git for Windows $version"
80 create_msysgit_tag
$version &&
82 /src
/mingw-w64
/release-easy.sh
&&
83 /src
/mingw-w64
/release-zlib.sh
&&
84 (cd src
/git-cheetah
/explorer
/ &&
85 make objects-clean
&& make &&
86 make objects-clean
&& make W64
=1)
93 echo "If that is okay, please call '$0 -f $version'" >&2
98 git update-index
--refresh &&
99 git diff-files
--quiet &&
100 git diff-index
--cached HEAD
--) ||
101 die
"Git submodule has dirty files"
103 test git.exe
= $
((printf 'git.exe\0'; git ls-files
-z) |
xargs --null ls -t 2>/dev
/null|
head -1)) ||
104 die
"Git's git.exe is not up-to-date (run 'cd /git && make' to fix)"
105 for f
in bin
/git
* libexec
/git-core
/git
*
112 basename=gitk-git
/gitk
114 */git-citool|
*/git-gui
)
115 basename=git-gui
/git-gui
117 */git-gui--askpass|
*/git-gui--askyesno|
*/git-gui.tcl
)
118 basename=git-gui
/$
(basename "$f")
121 basename=$
(basename "$f")
124 cmp "$f" "git/$basename" ||
125 die
"Installed Git disagrees with contents of /git/ ($f)"
127 (git update-index
--refresh &&
128 git diff-files
--quiet &&
129 git diff-index
--cached HEAD
--) ||
130 die
"msysGit super project not up-to-date"
132 test ! -z "$(git tag --contains HEAD)") ||
133 die
"Git's HEAD is untagged"
137 unset DONT_REMOVE_BUILTINS
139 $MSYSGITROOT/share
/WinGit
/copy-files.sh
$TMPDIR &&
140 sed -e '/share\/msysGit/d' -e "s/msysGit/Git (version $version)/" \
141 < etc
/motd
> $TMPDIR/etc
/motd
&&
142 cp share
/resources
/gpl-2.0.rtf
share
/resources
/git.bmp
share
/resources
/gitsmall.bmp
$TMPDIR &&
143 sed -e "s/%APPVERSION%/$version/" \
144 < share
/WinGit
/install.iss
> $TMPDIR/install.iss
&&
145 cp share
/WinGit
/*.inc.iss
$TMPDIR &&
146 echo "Launching Inno Setup compiler ..." &&
148 if test -x $MSYSGITROOT/share
/InnoSetup
/ISCC.exe
150 $MSYSGITROOT/share
/InnoSetup
/ISCC.exe
install.iss
152 case $
(wine
--version) in
153 wine-0
*|wine-1.
[012]*|wine-1.3.
[0-9]|wine-1.3.
[0-9]-*|wine-1.3
.1[0-4]|wine-1.3
.1[0-4]-*)
154 echo "You need at least WINE version 1.3.15" >&2 &&
157 wine
$MSYSGITROOT/share
/InnoSetup
/ISCC.exe
install.iss
158 fi > /tmp
/install.out
&&
159 echo $?
> /tmp
/install.status
) &&
160 (test 0 = "$(cat /tmp/install.status)") &&
161 git tag
-a -m "Git for Windows $1" Git-
$1 &&
162 echo "Installer is available as $(tail -n 1 /tmp/install.out)"