3 # wget -O new_home_directory 'http://git.donarmstrong.com/?p=bin.git;a=blob_plain;f=new_home_directory;hb=HEAD'
4 # sh new_home_directory;
7 # makes a new home directory; defaults to one that does not use ssh
8 GIT_BASE=http://git.donarmstrong.com/
10 if [ "$1" = "ssh" ]; then
11 GIT_BASE=git+ssh://git.donarmstrong.com/srv/git/
16 for pkg in mr vcsh; do
17 if ! which $pkg >/dev/null 2>&1; then
18 echo "Package $pkg doesn't exist; getting it"
19 mkdir -p local_packages/$pkg;
20 (cd local_packages/$pkg;
21 if which apt-get >/dev/null 2>&1; then
22 apt-get download $pkg;
23 dpkg-deb -x $pkg*.deb .
25 # ok, this host isn't Debian.
26 if [ "$pkg" == "mr" ]; then
27 wget http://http.debian.net/debian/pool/main/m/myrepos/myrepos_1.20160123_all.deb
28 ar p myrepos*.deb data.tar.xz|xz --decompress|tar -x
29 elif [ "$pkg" == "vcsh" ]; then
30 wget http://http.debian.net/debian/pool/main/v/vcsh/vcsh_1.20151229-1_all.deb
31 ar p vcsh*.deb data.tar.xz|xz --decompress|tar -x
37 ln ~/local_packages/$pkg/usr/bin/$pkg bin/$pkg -s
38 if [ "$pkg" == "mr" ]; then
39 echo -e "[DEFAULT]\ninclude = cat ~/local_packages/$pkg/usr/share/mr/*" >> ~/.mrconfig
41 PATH="$HOME/local_packages/$pkg/usr/bin/:$PATH"
46 # .config is currently a link; this indicates that we are dealing with my old configuration system
51 cp -r ${a}_bak/* ${a}/;
56 if [ -d ${a}/.svn ]; then
61 if [ "$1" = "ssh" ]; then
64 git checkout git+ssh://git.donarmstrong.com/srv/git_private/mr.git
66 mr --config ~/.config/mr/config.d/base.git checkout
68 vcsh clone $GIT_BASE/mr.git mr;
73 for a in .zsh .ssh; do
78 cp -r ${a}_bak/* ${a}/;
82 if [ ! -e .ssh/authorized_keys ]; then
83 (cd .ssh/; ln authorized_keys_default authorized_keys -s; )
86 # do some cleanup; you might want to run git reset --hard in some
87 # cases; we don't do so automatically in case there are local changes
89 mr run git reset --soft origin/master
92 # move mr and vcsh to ~/bin if they are in ~/bin.bak
93 for pkg in mr vcsh; do
94 if [ -e ~/bin.bak/$pkg ]; then
95 mv ~/bin.bak/$pkg ~/bin/;