From 1a4408effeb6cac14b1003a80214fd68e2e91370 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 22 Nov 2008 15:14:52 +0100 Subject: bootstrap: Allow custom PKG_PATH --- include/bootstrap | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/bootstrap b/include/bootstrap index 202f2c3..43d818f 100755 --- a/include/bootstrap +++ b/include/bootstrap @@ -6,12 +6,18 @@ # and also have an excuse for using zsh here :P typeset -i rcempty=0 -typeset PKG_ROOT +typeset PKG_ROOT PKG_PATH default_path='~/packages' if [[ -n $1 ]] { PKG_ROOT=$1 + PKG_PATH=${~${2-$default_path}} } else { - echo 'Usage: ./bootstrap PKG_ROOT' + cat <<- meow + Usage: ./bootstrap PKG_ROOT [PKG_PATH] + PKG_ROOT is an URL, either of the form proto://host/path, or just /path + PKG_PATH is the path where pkg and all further packages will be installed, + by default $default_path + meow exit 100 } @@ -26,7 +32,7 @@ if ! [[ -e ~/.zshrc ]] { # Make basic dirctories echo 'Creating the basic directory structure' mkdir -p ~/bin -mkdir -p ~/packages/.collected/man/man{1..8} +mkdir -p $PKG_PATH/.collected/man/man{1..8} if ! which git &> /dev/null; then echo 'It appears that git is not available on this system.' @@ -36,12 +42,13 @@ if ! which git &> /dev/null; then fi echo 'Fetching the core package...' -cd ~/packages +cd $PKG_PATH git clone $PKG_ROOT/core cd core || exit 1 echo 'Writing pkg.conf' echo "PKG_ROOT='$PKG_ROOT'" > ~/.pkg.conf +echo "PKG_PATH=\"${PKG_PATH/$HOME/\$HOME}\"" >> ~/.pkg.conf echo 'Installing core package' bin/checklinks -- cgit v1.2.3