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