5 URL
=http
://www.openssl.org
/source
/$DIR.
tar.gz
13 replace_symlinks_with_copies
() {
15 SYMLINKS
="$(git ls-tree -r $BRANCH: | sed -n 's/^120000.\{47\}//p')" &&
16 if test -z "$SYMLINKS"
18 die
"No symlinks found? You need to update your /git/."
20 (export GIT_INDEX_FILE
=.git
/tmp
&&
21 git read-tree
$BRANCH &&
23 total
=$
(echo "$SYMLINKS" |
wc -l) &&
24 UPDATES
="$(echo "$SYMLINKS" |
27 printf "\rProcessing symlink
($i/$total)" >&2 &&
29 BASEDIR="${path%/*}/" &&
30 TARGET="$
(git cat-file blob
$BRANCH:$path)" &&
31 while test "$TARGET" != "${TARGET#../}"
33 BASEDIR="$
(echo "$BASEDIR" |
34 sed 's|[^/]*/$||')" &&
35 TARGET="${TARGET#../}"
37 git ls-files --stage "$BASEDIR$TARGET" |
40 echo "$UPDATES" | git update-index
--index-info &&
41 TREE
=$
(git write-tree
) &&
42 COMMIT
=$
(echo "Replace symlinks with copies" |
43 git commit-tree
$TREE -p $BRANCH) &&
44 git update-ref refs
/heads
/$BRANCH $COMMIT)
50 test $
(ls ..
/patches
/*.
patch |
wc -l) = \
51 $
(($
(git rev-list HEAD |
wc -l)-2)) && return
52 git am ..
/patches
/*.
patch
58 die
"Could not download OpenSSL"
63 /git
/contrib
/fast-import
/import-tars.perl ..
/$FILE
65 } || die
"Could not check out openssl"
67 test $
(cat $DIR/apps
/md4.c
2> /dev
/null |
wc -l) -gt 2 ||
(
69 replace_symlinks_with_copies import-tars
&&
70 git checkout import-tars
&&
71 test $
(wc -l < apps
/md4.c
) -gt 2
72 ) || die
"Could not replace symlinks with copies"
74 test grep INSTALLTOP
=/mingw
$DIR/Makefile
> /dev
/null
2>&1 ||
(
77 ) || die
"Could not apply the patches"
79 test -f $DIR/openssl.dll ||
(
81 cmd
/c ms
\\mingw32.bat
&&
82 index
=$
(/share
/msysGit
/pre-install.sh
) &&
84 /share
/msysGit
/post-install.sh
$index "Install $FILE"
85 ) || die
"Could not install $FILE"