[commit: Cabal] master: Allow use of curl in bootstrap.sh (101d2e0)
Ian Lynagh
igloo at earth.li
Fri Jun 24 01:59:16 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/101d2e0a0921f8d1e1a83ab78dfaeddf8838c80b
>---------------------------------------------------------------
commit 101d2e0a0921f8d1e1a83ab78dfaeddf8838c80b
Author: Duncan Coutts <duncan at haskell.org>
Date: Tue Aug 26 23:34:00 2008 +0000
Allow use of curl in bootstrap.sh
Patch from jsnx. Fixes ticket #343. Also, use "cd blah; cd .."
instead of "pushd blah; popd" as some shells lack pushd/popd
>---------------------------------------------------------------
cabal-install/bootstrap.sh | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/cabal-install/bootstrap.sh b/cabal-install/bootstrap.sh
index bf814b5..bc94329 100644
--- a/cabal-install/bootstrap.sh
+++ b/cabal-install/bootstrap.sh
@@ -15,23 +15,34 @@ CABAL_URL=${HACKAGE_URL}/Cabal/${CABAL_VER}/Cabal-${CABAL_VER}.tar.gz
HTTP_URL=${HACKAGE_URL}/HTTP/${HTTP_VER}/HTTP-${HTTP_VER}.tar.gz
ZLIB_URL=${HACKAGE_URL}/zlib/${ZLIB_VER}/zlib-${ZLIB_VER}.tar.gz
-wget ${CABAL_URL} ${HTTP_URL} ${ZLIB_URL}
+case `which wget curl` in
+ *curl)
+ curl -O ${CABAL_URL} -O ${HTTP_URL} -O ${ZLIB_URL}
+ ;;
+ *wget)
+ wget ${CABAL_URL} ${HTTP_URL} ${ZLIB_URL}
+ ;;
+ *)
+ echo "Failed to find a downloader, 'wget' or 'curl' is required" >&2
+ exit 2
+ ;;
+esac
tar -zxf Cabal-${CABAL_VER}.tar.gz
-pushd Cabal-${CABAL_VER}
+cd Cabal-${CABAL_VER}
ghc --make Setup
./Setup configure --user && ./Setup build && ./Setup install
-popd
+cd ..
tar -zxf HTTP-${HTTP_VER}.tar.gz
-pushd HTTP-${HTTP_VER}
+cd HTTP-${HTTP_VER}
runghc Setup configure --user && runghc Setup build && runghc Setup install
-popd
+cd ..
tar -zxf zlib-${ZLIB_VER}.tar.gz
-pushd zlib-${ZLIB_VER}
+cd zlib-${ZLIB_VER}
runghc Setup configure --user && runghc Setup build && runghc Setup install
-popd
+cd ..
runghc Setup configure --user && runghc Setup build && runghc Setup install
More information about the Cvs-libraries
mailing list