Commit 4c13f850 authored by jake's avatar jake Committed by Jake Wheat
Browse files

allow cabal-install bootstrap.sh without user package database

This changes how the SCOPE_OF_INSTALLATION variable is used to provide
an alternate way of running bootstrap.sh which can install
cabal-install to a separate prefix and package database without
altering the user's package database or using it. The idea with this
is to improve the repeatability of automatically installing ghc, cabal
and other haskell independently of the current standard installation
or the user's main package database.

Usage example:

ghc-pkg init /home/jake/test_cabal/
SCOPE_OF_INSTALLATION='--global --package-db=/home/jake/test_cabal/packagedb' PREFIX=/home/jake/test_cabal/prefix ./bootstrap.sh

If you don't override the SCOPE_OF_INSTALLATION variable, bootstrap.sh
works as before.
parent ba02fa63
......@@ -28,7 +28,7 @@ CURL="${CURL:-curl}"
FETCH="${FETCH:-fetch}"
TAR="${TAR:-tar}"
GZIP_PROGRAM="${GZIP_PROGRAM:-gzip}"
SCOPE_OF_INSTALLATION="--user"
SCOPE_OF_INSTALLATION="${SCOPE_OF_INSTALLATION:---user}"
DEFAULT_PREFIX="${HOME}/.cabal"
# Try to respect $TMPDIR but override if needed - see #1710.
......@@ -246,7 +246,7 @@ install_pkg () {
die "Documenting the ${PKG} package failed."
fi
./Setup install ${SCOPE_OF_INSTALLATION} ${EXTRA_INSTALL_OPTS} ${VERBOSE} ||
./Setup install ${EXTRA_INSTALL_OPTS} ${VERBOSE} ||
die "Installing the ${PKG} package failed."
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment