summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-11-22 15:14:52 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-11-22 15:14:52 +0100
commit1a4408effeb6cac14b1003a80214fd68e2e91370 (patch)
tree3572bc9506bb6db0e0524d38425f477ae02bf72d /include
parent2d78a1b6438af4310c6fcd02551628fc59b259d5 (diff)
bootstrap: Allow custom PKG_PATH
Diffstat (limited to 'include')
-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