Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/61069dbc93cbf7604f53959677d6c53a36f1978e

>---------------------------------------------------------------

commit 61069dbc93cbf7604f53959677d6c53a36f1978e
Author: Dino Morelli <[email protected]>
Date:   Sat Jun 13 15:09:58 2009 +0000

    Now supporting explicit --user or --global switches in bootstrap.sh with 
usage feedback for bad args
    This change was adapted from work submitted to the cabal-devel mailing list 
by Jason Dusek.

>---------------------------------------------------------------

 cabal-install/bootstrap.sh |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/cabal-install/bootstrap.sh b/cabal-install/bootstrap.sh
index cbdfaac..0612920 100644
--- a/cabal-install/bootstrap.sh
+++ b/cabal-install/bootstrap.sh
@@ -18,6 +18,29 @@ WGET=${WGET:-wget}
 CURL=${CURL:-curl}
 TAR=${TAR:-tar}
 GUNZIP=${GUNZIP:-gunzip}
+SCOPE_OF_INSTALLATION="--user"
+
+
+for arg in $*
+do
+  case "${arg}" in
+    "--user")
+      SCOPE_OF_INSTALLATION=${arg}
+      shift;;
+    "--global")
+      SCOPE_OF_INSTALLATION=${arg}
+      PREFIX="/usr/local"
+      shift;;
+    *)
+      echo "Unknown argument or option, quitting: ${arg}"
+      echo "usage: bootstrap.sh [OPTION]"
+      echo
+      echo "options:"
+      echo "   --user    Install for the local user (default)"
+      echo "   --global  Install systemwide"
+      exit;;
+  esac
+done
 
 
 # Versions of the packages to install.
@@ -138,7 +161,7 @@ install_pkg () {
     || die "Compiling the Setup script failed"
   [ -x Setup ] || die "The Setup script does not exist or cannot be run"
 
-  ./Setup configure --user "--prefix=${PREFIX}" \
+  ./Setup configure ${SCOPE_OF_INSTALLATION} "--prefix=${PREFIX}" \
     --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} \
     ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} \
     || die "Configuring the ${PKG} package failed"



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to