19 die
"$0 (msys|bash) [options]"
25 test "a$1" = "a--debug" && debug
=t
27 test "$debug" = "$(cat debug.txt 2>/dev/null)" || debug_clean
=t
28 echo "$debug" > debug.txt
30 test -d ..
/msys
/msys
/rt ||
33 git submodule update
--init src
/msys
35 die
"Could not check out msys.git"
38 echo "Huh? ../msys does not exist."
42 current
=$
(git rev-list
--no-merges origin
/master.. |
wc -l) &&
43 total
=$
(ls ..
/rt
/patches
/*.
patch |
wc -l) &&
45 while test $i -le $total
47 test $i -le $current ||
48 git am ..
/rt
/patches
/$
(printf "%04d" $i)*.
patch ||
49 die
"Error: Applying patches failed."
55 release
=MSYS-g$
(git show
-s --pretty=%h HEAD
) ||
56 die
"Could not detect MSYS release"
58 test -f /bin
/cc.exe ||
ln gcc.exe
/bin
/cc.exe ||
59 die
"Could not make sure that MSys cc is found instead of MinGW one"
63 (export MSYSTEM
=MSYS
&&
64 export PATH
=/bin
:$PATH &&
66 (test -d bld || mkdir bld
) &&
68 DLL
=i686-pc-msys
/winsup
/cygwin
/new-msys-1.0.dll
&&
69 (test -f Makefile
&& test -z "$debug_clean" ||
70 ..
/src
/configure
--prefix=/usr
) &&
71 (test -z "$debug" || perl
-i.bak
-pe 's/-O2//g' $
(find -name Makefile
)) &&
72 (test -z "$debug_clean" ||
make clean
) &&
73 (make ||
test -f $DLL) &&
74 (test ! -z "$debug" || strip
$DLL) &&
75 rebase
-b 0x68000000 $DLL &&
78 hash=$
(git hash-object
-w bin
/new-msys-1.0.dll
) &&
79 git update-index
--cacheinfo 100755 $hash bin
/msys-1.0.dll
&&
80 git commit
-s -m "Updated msys-1.0.dll to $release" &&
81 /share
/msysGit
/post-checkout-hook HEAD^ HEAD
1
86 (export MSYSTEM
=MSYS
&&
87 export PATH
=/bin
:$PATH &&
89 (test -d bld || mkdir bld
) &&
92 (test -f Makefile
&& test -z "$debug_clean" ||
96 --localstatedir=/var \
100 (test -z "$debug" || perl
-i.bak
-pe 's/-O2//g' $
(find -name Makefile
)) &&
101 (test -z "$debug_clean" ||
make clean
) &&
104 (test ! -z "$debug" || strip
$BASH) &&
105 cp $BASH /bin
/new-bash.exe
) &&
107 hash=$
(git hash-object
-w bin
/new-bash.exe
) &&
108 git update-index
--cacheinfo 100755 $hash bin
/bash.exe
&&
109 git update-index
--cacheinfo 100755 $hash bin
/sh.exe
&&
110 git commit
-s -m "Updated bash.exe to $release" &&
111 /share
/msysGit
/post-checkout-hook HEAD^ HEAD
1