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
() {
56 tag
=$
(git describe HEAD | cut
-d- -f1) &&
57 tag
=${tag%.msysgit.*} &&
58 while ! git tag
-a -m "Git for Windows $1" $tag.msysgit.
$i
64 # compile everything needed for standard setup
65 test "$do_compile" && {
66 wordpad
share
/WinGit
/ReleaseNotes.rtf
&& {
67 ( # create a commit if ReleaseNotes changed
68 if test ! -z "$(git diff share/WinGit/ReleaseNotes.rtf)"
70 git add
share
/WinGit
/ReleaseNotes.rtf
&&
71 git commit
-m "Git for Windows $version"
74 create_msysgit_tag
$version &&
76 (cd src
/git-cheetah
/explorer
/ && make)
83 echo "If that is okay, please call '$0 -f $version'" >&2
88 git update-index
--refresh &&
89 git diff-files
--quiet &&
90 git diff-index
--cached HEAD
--) ||
91 die
"Git submodule has dirty files"
93 test git.exe
= $
((printf 'git.exe\0'; git ls-files
-z) |
xargs --null ls -t 2>/dev
/null|
head -1)) ||
94 die
"Git's git.exe is not up-to-date (run 'cd /git && make' to fix)"
95 for f
in bin
/git
* libexec
/git-core
/git
*
102 basename=gitk-git
/gitk
104 */git-citool|
*/git-gui
)
105 basename=git-gui
/git-gui
107 */git-gui--askpass|
*/git-gui--askyesno|
*/git-gui.tcl
)
108 basename=git-gui
/$
(basename "$f")
111 basename=$
(basename "$f")
114 cmp "$f" "git/$basename" ||
115 die
"Installed Git disagrees with contents of /git/ ($f)"
117 (git update-index
--refresh &&
118 git diff-files
--quiet &&
119 git diff-index
--cached HEAD
--) ||
120 die
"msysGit super project not up-to-date"
122 test ! -z "$(git tag --contains HEAD)") ||
123 die
"Git's HEAD is untagged"
127 unset DONT_REMOVE_BUILTINS
129 $MSYSGITROOT/share
/WinGit
/copy-files.sh
$TMPDIR &&
130 sed -e '/share\/msysGit/d' -e "s/msysGit/Git (version $version)/" \
131 < etc
/motd
> $TMPDIR/etc
/motd
&&
132 cp share
/resources
/gpl-2.0.rtf
share
/resources
/git.bmp
share
/resources
/gitsmall.bmp
$TMPDIR &&
133 sed -e "s/%APPVERSION%/$version/" \
134 < share
/WinGit
/install.iss
> $TMPDIR/install.iss
&&
135 cp share
/WinGit
/*.inc.iss
$TMPDIR &&
136 echo "Launching Inno Setup compiler ..." &&
138 if test -x $MSYSGITROOT/share
/InnoSetup
/ISCC.exe
140 $MSYSGITROOT/share
/InnoSetup
/ISCC.exe
install.iss
142 case $
(wine
--version) in
143 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]-*)
144 echo "You need at least WINE version 1.3.15" >&2 &&
147 wine
$MSYSGITROOT/share
/InnoSetup
/ISCC.exe
install.iss
148 fi > /tmp
/install.out
&&
149 echo $?
> /tmp
/install.status
) &&
150 (test 0 = "$(cat /tmp/install.status)") &&
151 git tag
-a -m "Git for Windows $1" Git-
$1 &&
152 echo "Installer is available as $HOME/Git-$version.exe"