summaryrefslogtreecommitdiff
path: root/include/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'include/bootstrap')
-rwxr-xr-xinclude/bootstrap15
1 files changed, 11 insertions, 4 deletions
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