Updated to Git v1.7.6
[msysgit.git] / share / WinGit / copy-files.sh
blob01f535b8196461adf95e8dd0794862a0ca8b7955
1 #!/bin/bash
3 test -z "$1" && {
4 echo "Usage: $0 <dir>"
5 exit 1
8 test -d doc/git/html/.git ||
9 (git submodule update --init doc/git/html/) || {
10 echo "Error: html pages in /doc/git/html/ missing"
11 exit 1
14 if test "$( cd doc/git/html/ ; git config core.autocrlf )" != "true"
15 then
16 echo "Error: documentation must be checked out with core.autocrlf=true."
17 echo "If you have changes in the documentation, hit Ctrl-C NOW."
18 sleep 3
19 (cd doc/git/html &&
20 git config core.autocrlf true &&
21 rm -rf *.html *.txt howto &&
22 git checkout -f) || {
23 echo "Could not fix documentation"
24 exit 1
28 SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
29 MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
30 TMPDIR=$1
32 (test ! -d "$TMPDIR" || echo "Removing $TMPDIR" && rm -rf "$TMPDIR") &&
33 mkdir "$TMPDIR" &&
34 cd "$TMPDIR" &&
35 echo "Copying files" &&
36 (git --git-dir=$MSYSGITROOT/doc/git/html/.git log --pretty=format:%s -1 HEAD &&
37 mkdir -p doc/git/html && cd doc/git/html &&
38 git --git-dir=$MSYSGITROOT/doc/git/html/.git archive HEAD | tar xf -) &&
39 (cd $MSYSGITROOT && tar cf - \
40 $(ls {bin,libexec/git-core}/git* | grep -v 'cvs\|shell\|archimport\|instaweb') \
41 bin/{antiword.exe,astextplain,awk,basename.exe,bash.exe,bison.exe,yacc,\
42 bunzip2,bzip2.exe,c_rehash,\
43 cat.exe,chmod.exe,clear,cmp.exe,cp.exe,cut.exe,cvs.exe,date.exe,diff.exe,\
44 dirname.exe,\
45 du.exe,echo,egrep,env.exe,expr.exe,false.exe,find.exe,flex.exe,gawk.exe,grep.exe,\
46 gunzip,gzip.exe,head.exe,id.exe,kill.exe,less.exe,libW11.dll,ln.exe,\
47 ls.exe,m4.exe,md5sum.exe,mkdir.exe,msys-1.0.dll,msysltdl-3.dll,mv.exe,patch.exe,\
48 patch.exe.manifest,perl.exe,printf,ps.exe,pwd,rm.exe,rmdir.exe,rxvt.exe,\
49 scp.exe,sed.exe,sh.exe,sleep.exe,sort.exe,split.exe,\
50 ssh-agent.exe,ssh.exe,ssh-add.exe,ssh-keygen.exe,ssh-keyscan.exe,\
51 tail.exe,tar.exe,tee.exe,touch.exe,tr.exe,true.exe,uname.exe,uniq.exe,vi,\
52 msys-perl5_8.dll,lib{apr,aprutil,expat,neon,z,svn}*.dll,pthreadGC2.dll,\
53 msys-crypto-0.9.8.dll,msys-regex-1.dll,msys-ssl-0.9.8.dll,msys-minires.dll,msys-z.dll,\
54 openssl.exe,vim,wc.exe,which,xargs.exe,start} lib/engines/ \
55 ssl/ cmd/ lib/perl5/ share/antiword/ share/bison/ share/git* \
56 share/vim/vimrc share/vim/vim73/{filetype.vim,ftoff.vim,menu.vim,optwin.vim,\
57 scripts.vim,\
58 autoload/netrw.vim,autoload/netrwFileHandlers.vim,autoload/netrwSettings.vim,\
59 plugin/netrwPlugin.vim,\
60 syntax/c.vim,syntax/conf.vim,syntax/cpp.vim,syntax/diff.vim,\
61 syntax/gitcommit.vim,syntax/gitconfig.vim,syntax/gitrebase.vim,syntax/git.vim,\
62 syntax/nosyntax.vim,syntax/syncolor.vim,syntax/synload.vim,syntax/syntax.vim,\
63 vim.exe}) |
64 tar xf - &&
65 rm -rf bin/cvs.exe &&
66 (test ! -f $MSYSGITROOT/lib/Git.pm || cp -u $MSYSGITROOT/lib/Git.pm lib/perl5/site_perl/Git.pm) &&
67 test -f lib/perl5/site_perl/Git.pm &&
68 gitmd5=$(md5sum bin/git.exe | cut -c 1-32) &&
69 mkdir etc &&
70 if test -z "$DONT_REMOVE_BUILTINS"
71 then
72 md5sum {bin,libexec/git-core}/git-*.exe libexec/git-core/git.exe |
73 sed -n -r "s/^$gitmd5\s+\*?(.*)/\1/p" > etc/fileList-builtins.txt &&
74 rm $(cat etc/fileList-builtins.txt)
75 fi &&
76 (cd $MSYSGITROOT/mingw && tar cf - \
77 bin/*{tcl,tk,wish,gpg,msmtp,curl.exe,*.crt}* bin/connect.exe \
78 bin/*{libcurl,libcrypto,libssl,libgsasl,libiconv}* \
79 bin/getcp.exe bin/rebase.exe \
80 bin/{libpoppler-7.dll,pdfinfo.exe,pdftotext.exe} \
81 lib/{tcl,tk,dde,reg}* libexec/gnupg/) |
82 tar xf - &&
83 cp $MSYSGITROOT/mingw/bin/hd2u.exe bin/dos2unix.exe &&
84 (md5sum $MSYSGITROOT/bin/msys-1.0.dll | awk '{print $1, "*/bin/msys-1.0.dll"}') > etc/msys-1.0.dll.md5 &&
85 strip bin/{[a-fh-z],g[a-oq-z]}*.exe libexec/git-core/*.exe &&
86 cp $MSYSGITROOT/git/contrib/completion/git-completion.bash etc/ &&
87 cp $MSYSGITROOT/etc/termcap etc/ &&
88 cp $MSYSGITROOT/etc/inputrc etc/ &&
89 sed 's/ = \/mingw\// = \//' < $MSYSGITROOT/etc/gitconfig > etc/gitconfig &&
90 cp $MSYSGITROOT/etc/gitattributes etc/ &&
91 cp $MSYSGITROOT/share/WinGit/Git\ Bash.vbs . &&
92 mkdir git-cheetah &&
93 cp $MSYSGITROOT/src/git-cheetah/explorer/git_shell_ext.dll git-cheetah/ &&
94 cp $MSYSGITROOT/share/WinGit/ReleaseNotes.rtf . &&
95 sed 's/^\. .*\(git-completion.bash\)/. \/etc\/\1/' \
96 < $MSYSGITROOT/etc/profile > etc/profile &&
97 cp $MSYSGITROOT/share/resources/git.ico etc/ ||
98 find bin libexec -iname \*.exe -o -iname \*.dll | sort > etc/fileList-bindimage.txt ||
99 exit 1