]> git.donarmstrong.com Git - bin.git/blob - new_home_directory
* update new_home_directory and make sa not run svn if it's just supposed to run...
[bin.git] / new_home_directory
1 #!/bin/sh
2
3 # makes a new home directory; defaults to one that does not use ssh
4 SVN_BASE=http://svn.donarmstrong.com/don/trunk
5
6 # check out bin and lib
7 cd ~;
8 svn co $SVN_BASE/bin
9 svn co $SVN_BASE/lib
10
11 # check out the .home modules
12 mkdir .home_modules;
13 (
14     cd .home_modules;
15     svn co $SVN_BASE/home_modules/base;
16     for module in $@; do
17         svn co $SVN_BASE/home_modules/$module;
18     done;
19 )
20 # make a home backup directory
21 mkdir home_backup;
22 for a in .wgetrc .svn .sversionrc .subversion .bash_profile .bashrc .ssh; do
23     mv $a home_backup/;
24 done;
25 mkdir .sa.d;
26 ln -s ~/.home_modules/*/sa_* .sa.d/;
27 # run the appropriate command to set the symlinks correctly
28 ~/bin/sa --hooks-only update
29 cat -<<EOF> .sa.d/sa_local
30 ~/bin
31 ~/lib
32 EOF
33 # move back the .ssh stuff
34 if [ -e home_backup/.ssh ]; then
35     cp -f home_backup/.ssh/* .ssh/;
36 fi;
37 exec ~/bin/sa update;