]> git.donarmstrong.com Git - bin.git/blob - new_home_directory
update new home directory
[bin.git] / new_home_directory
1 #!/bin/sh
2
3 # makes a new home directory; defaults to one that does not use ssh
4 GIT_BASE=http://git.donarmstrong.com/
5
6 if [ "$1" = "ssh" ]; then
7     GIT_BASE=git+ssh://git.donarmstrong.com/srv/git/
8 fi;
9
10 cd ~;
11
12 for pkg in mr vcsh; do
13     if ! which $pkg >/dev/null 2>&1; then
14         echo "Package $pkg doesn't exist; getting it"
15         mkdir -p local_packages/$pkg;
16         (cd local_packages/$pkg;
17             apt-get download $pkg;
18             dpkg-deb -x $pkg*.deb .
19         );
20         mkdir -p bin
21         ln ~/local_packages/$pkg/usr/bin/$pkg bin/$pkg -s
22         if [ "$pkg" == "mr" ]; then
23             echo "include = cat ~/local_packages/$pkg/usr/share/mr/*" >> ~/.mrconfig
24         fi;
25     fi;
26 done;
27
28 # .config is currently a link; this indicates that we are dealing with my old configuration system
29 if [ -L .config ]; then
30     mv .config .config_bak;
31     mkdir -p .config;
32     cp -r .config_bak/* .config/;
33 fi;
34
35 if [ -d lib/.svn ]; then
36     mv lib/.svn lib/.svn_bak;
37 fi;
38
39 if [ "$1" = "ssh" ]; then
40     mkdir -p .config/;
41     (cd .config/;
42         git checkout git+ssh://git.donarmstrong.com/srv/git_private/mr.git
43     );
44     mr --config ~/.config/mr/config.d/base.git checkout
45 else 
46     vcsh clone $GIT_BASE/mr.git mr;
47 fi;
48 mr checkout;
49 if [ ! -e .ssh/authorized_keys ]; then
50     (cd .ssh/; ln authorized_keys_default authorized_keys -s;)
51 fi;