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 (cd git
/contrib
/subtree
&&
83 make install INSTALL
=/bin
/install prefix
=) &&
84 (cd git
/contrib
/credential
/wincred
&&
85 make install INSTALL
=/bin
/install prefix
=) &&
86 /src
/mingw-w64
/release-easy.sh
&&
87 /src
/mingw-w64
/release-zlib.sh
&&
88 (cd src
/git-cheetah
/explorer
/ &&
89 make objects-clean
&& make &&
90 make objects-clean
&& make W64
=1)
97 echo "If that is okay, please call '$0 -f $version'" >&2
102 git update-index
--refresh &&
103 git diff-files
--quiet &&
104 git diff-index
--cached HEAD
--) ||
105 die
"Git submodule has dirty files"
107 test git.exe
= $
((printf 'git.exe\0'; git ls-files
-z) |
xargs --null ls -t 2>/dev
/null|
head -1)) ||
108 die
"Git's git.exe is not up-to-date (run 'cd /git && make' to fix)"
109 for f
in bin
/git
* libexec
/git-core
/git
*
116 basename=gitk-git
/gitk
118 */git-citool|
*/git-gui
)
119 basename=git-gui
/git-gui
121 */git-gui--askpass|
*/git-gui--askyesno|
*/git-gui.tcl
)
122 basename=git-gui
/$
(basename "$f")
125 basename=contrib
/subtree
/$
(basename "$f")
127 */git-credential-wincred.exe
)
128 basename=contrib
/credential
/wincred
/$
(basename "$f")
131 basename=$
(basename "$f")
134 cmp "$f" "git/$basename" ||
135 die
"Installed Git disagrees with contents of /git/ ($f)"
137 (git update-index
--refresh &&
138 git diff-files
--quiet &&
139 git diff-index
--cached HEAD
--) ||
140 die
"msysGit super project not up-to-date"
142 test ! -z "$(git tag --contains HEAD)") ||
143 die
"Git's HEAD is untagged"
147 unset DONT_REMOVE_BUILTINS
149 $MSYSGITROOT/share
/WinGit
/copy-files.sh
$TMPDIR &&
150 sed -e '/share\/msysGit/d' -e "s/msysGit/Git (version $version)/" \
151 < etc
/motd
> $TMPDIR/etc
/motd
&&
152 cp share
/resources
/gpl-2.0.rtf
share
/resources
/git.bmp
share
/resources
/gitsmall.bmp
$TMPDIR &&
153 sed -e "s/%APPVERSION%/$version/" \
154 < share
/WinGit
/install.iss
> $TMPDIR/install.iss
&&
155 cp share
/WinGit
/*.inc.iss
$TMPDIR &&
156 echo "Launching Inno Setup compiler ..." &&
158 if test -x $MSYSGITROOT/share
/InnoSetup
/ISCC.exe
160 $MSYSGITROOT/share
/InnoSetup
/ISCC.exe
install.iss
162 case $
(wine
--version) in
163 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]-*)
164 echo "You need at least WINE version 1.3.15" >&2 &&
167 wine
$MSYSGITROOT/share
/InnoSetup
/ISCC.exe
install.iss
168 fi > /tmp
/install.out
&&
169 echo $?
> /tmp
/install.status
) &&
170 (test 0 = "$(cat /tmp/install.status)") &&
171 git tag
-a -m "Git for Windows $1" Git-
$1 &&
172 echo "Installer is available as $(tail -n 1 /tmp/install.out)"