summaryrefslogtreecommitdiff
path: root/bin/bootstrap
blob: 7609ed8df5cea5a861fcd3053f5d8f5f7eff5c5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env zsh
# bootstrap - populate a home with the most necessary scripts
# After running this, other packages can be installed using 'pkg'

HG=hg

# Make basic dirctories
mkdir -p ~/bin
mkdir -p ~/lib
mkdir -p ~/packages
mkdir -p ~/var/tmp/incoming

if ( ! which hg &> /dev/null) {
	echo 'Mercurial not found, fetching...'
	cd ~/packages
	ssh derf.homelinux.org 'tar cz -C ~/var/packages_root .mercurial-bin' | tar xz
	HG="$HOME/packages/.mercurial-bin/mercurial-1.0.1/hg"
}

# Fetch the core package, containing checklinks and pkg
cd ~/packages
echo "fetching core"
$HG clone ssh://derf.homelinux.org/var/packages_root/core

# Create symlinks for pkg and checklinks
cd core
bin/checklinks
if ([ -d $HOME/packages/.mercurial-bin ]) {
	cd ~/packages/.mercurial-bin
	~/bin/checklinks
}