4 echo "Usage: $0 <version>"
8 TARGET
="$HOME"/WinGit-
$1.exe
9 OPTS7
="-m0=lzma -mx=9 -md=64M"
14 (test ! -d "$TMPDIR" ||
echo "Removing $TMPDIR" && rm -rf "$TMPDIR") &&
16 (cd "$(dirname "$0")" &&
18 mkdir
"$TMPDIR"/bin
&&
19 cp create-shortcut.exe
"$TMPDIR"/bin
) &&
21 echo "Copying files" &&
22 (cd / && tar cf
- bin
/{git
*,awk,basename.exe
,bash.exe
,bunzip2
,bzip2.exe
,cat.exe
,chmod.exe
,clear,cmp.exe
,cp.exe
,cpio,cut.exe
,cvs.exe
,date.exe
,diff.exe
,du.exe
,echo,egrep,env.exe
,expr.exe
,false.exe
,find.exe
,gawk.exe
,grep.exe
,gunzip
,gzip.exe
,head.exe
,id.exe
,less.exe
,libW11.dll
,libperl.dll
,ln.exe
,ls.exe
,md5sum.exe
,mkdir.exe
,msys-1.0.dll
,msysltdl-3.dll
,mv.exe
,patch.exe
,patch.exe.manifest
,perl.exe
,printf,ps.exe
,pwd,rm.exe
,rmdir.exe
,rxvt.exe
,scp.exe
,sed.exe
,sh.exe
,sleep.exe
,sort.exe
,split.exe
,ssh-agent.exe
,ssh.exe
,tail.exe
,tar.exe
,tee.exe
,touch.exe
,tr.exe
,true.exe
,uname.exe
,uniq.exe
,vi
,vim.exe
,wc.exe
,which,xargs.exe
} lib
/perl
5/) |
24 mkdir lib
/perl
5/site_perl
&&
25 cp /lib
/{Error.pm
,Git.pm
} lib
/perl
5/site_perl
/ &&
26 gitmd5
=$
(md5sum bin
/git.exe | cut
-c 1-32) &&
27 md5sum bin
/git-
*.exe |
sed -n "s/^$gitmd5 \\*//p" > fileList-builtins.txt
&&
28 rm $
(cat fileList-builtins.txt
) &&
29 (cd /mingw
&& tar cf
- bin
/*{tcl
,tk
,wish
,gpg
,curl.exe
}* \
30 lib
/*{tcl
,tk
}* libexec
/gnupg
/) |
32 strip bin
/{[a-fh-z
],g
[a-oq-z
]}*.exe
&&
34 cp /git
/contrib
/completion
/git-completion.bash etc
/ &&
35 cp /etc
/termcap etc
/ &&
36 sed 's/^\. .*\(git-completion.bash\)/. \/etc\/\1/' \
37 < /etc
/profile
> etc
/profile
&&
38 cp /share
/resources
/git.ico etc
/ &&
39 cp /share
/WinGit
/install.tcl .
/ &&
41 find * -type f |
sed "s|^\./||" > "$LIST7" &&
42 7z a
$OPTS7 $TARGET7 @
"$LIST7" ||
45 (cat /share
/7-Zip/7zSD.sfx
&&
46 echo ';!@Install@!UTF-8!' &&
47 echo 'Progress="yes"' &&
48 echo 'Title="WinGit: MinGW Git + minimal MSys installation"' &&
49 echo 'BeginPrompt="This program installes a complete Git for MSys setup"' &&
50 echo 'CancelPrompt="Do you want to cancel WinGit installation?"' &&
51 echo 'ExtractDialogText="Please, wait..."' &&
52 echo 'ExtractPathText="Where do you want to install WinGit?"' &&
53 echo 'ExtractTitle="Extracting..."' &&
54 echo 'GUIFlags="8+32+64+256+4096"' &&
56 echo 'InstallPath="%PROGRAMFILES%\\Git"' &&
57 echo 'OverwriteMode="2"' &&
58 echo 'RunProgram="\"%%T\\bin\\wish.exe\" \"%%T\install.tcl\" \"%%T\""' &&
59 echo ';!@InstallEnd@!7z' &&
60 cat $TARGET7) > "$TARGET"