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=https://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;
22 if [ $pkg = "mr" ]; then
25 if which apt-get >/dev/null 2>&1; then
26 apt-get download $deb_name;
27 dpkg-deb -x ${deb_name}*.deb .
29 # ok, this host isn't Debian.
30 if [ "$pkg" = "mr" ]; then
31 wget http://http.debian.net/debian/pool/main/m/myrepos/myrepos_1.20160123_all.deb
32 ar p myrepos*.deb data.tar.xz|xz --decompress|tar -x
33 elif [ "$pkg" = "vcsh" ]; then
34 wget http://http.debian.net/debian/pool/main/v/vcsh/vcsh_1.20151229-1_all.deb
35 ar p vcsh*.deb data.tar.xz|xz --decompress|tar -x
41 ln ~/local_packages/$pkg/usr/bin/$pkg bin/$pkg -s
42 if [ "$pkg" = "mr" ]; then
43 printf '[DEFAULT]\ninclude = cat ~/local_packages/%s/usr/share/mr/*' "$pkg" >> ~/.mrconfig
45 PATH="$HOME/local_packages/$pkg/usr/bin/:$PATH"
50 # .config is currently a link; this indicates that we are dealing with my old configuration system
55 cp -r ${a}_bak/* ${a}/;
60 if [ -d ${a}/.svn ]; then
65 if [ "$1" = "ssh" ]; then
68 git checkout git+ssh://git.donarmstrong.com/srv/git_private/mr.git
70 mr --config ~/.config/mr/config.d/base.git checkout
72 vcsh clone $GIT_BASE/mr.git mr;
77 for a in .zsh .ssh; do
82 cp -r ${a}_bak/* ${a}/;
86 if [ ! -e .ssh/authorized_keys ]; then
87 (cd .ssh/; ln authorized_keys_default authorized_keys -s; )
90 if [ ! -e ~/bin/.git ]; then
91 # OK, bin must have already existed; check it out directly
93 PATH=~/bin.tmp:$PATH mr checkout bin;
98 # do some cleanup; you might want to run git reset --hard in some
99 # cases; we don't do so automatically in case there are local changes
100 # that should be kept
101 mr run git reset --soft origin/master
104 # move mr and vcsh to ~/bin if they are in ~/bin.bak
105 for pkg in mr vcsh; do
106 if [ -e ~/bin.bak/$pkg ]; then
107 mv ~/bin.bak/$pkg ~/bin/;