X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=new_home_directory;h=94348da9eba40d1cfd661614c591b5247b9b8f00;hb=14f8ccc34cfd4fc6c01a594b5cb28c88964a24b3;hp=99585bdb10e4e994649be1eb07e45b20c7c8272d;hpb=ea40fa6e1517d2d25cccf0cfc50a5f58ca24614f;p=bin.git diff --git a/new_home_directory b/new_home_directory index 99585bd..94348da 100755 --- a/new_home_directory +++ b/new_home_directory @@ -18,13 +18,25 @@ for pkg in mr vcsh; do echo "Package $pkg doesn't exist; getting it" mkdir -p local_packages/$pkg; (cd local_packages/$pkg; - apt-get download $pkg; - dpkg-deb -x $pkg*.deb . + if which apt-get >/dev/null 2>&1; then + apt-get download $pkg; + dpkg-deb -x $pkg*.deb . + else + # ok, this host isn't Debian. + if [ "$pkg" == "mr" ]; then + wget http://http.debian.net/debian/pool/main/m/myrepos/myrepos_1.20160123_all.deb + ar p myrepos*.deb data.tar.xz|xz --decompress|tar -x + elif [ "$pkg" == "vcsh" ]; then + wget http://http.debian.net/debian/pool/main/v/vcsh/vcsh_1.20151229-1_all.deb + ar p vcsh*.deb data.tar.xz|xz --decompress|tar -x + fi; + + fi; ); mkdir -p bin ln ~/local_packages/$pkg/usr/bin/$pkg bin/$pkg -s if [ "$pkg" == "mr" ]; then - echo "include = cat ~/local_packages/$pkg/usr/share/mr/*" >> ~/.mrconfig + echo -e "[DEFAULT]\ninclude = cat ~/local_packages/$pkg/usr/share/mr/*" >> ~/.mrconfig fi; PATH="$HOME/local_packages/$pkg/usr/bin/:$PATH" export PATH @@ -46,7 +58,7 @@ for a in lib bin; do fi; done; -if [ "$1" = "ssh" ]; then +if [ "$1" == "ssh" ]; then mkdir -p .config/; (cd .config/; git checkout git+ssh://git.donarmstrong.com/srv/git_private/mr.git @@ -55,6 +67,7 @@ if [ "$1" = "ssh" ]; then else vcsh clone $GIT_BASE/mr.git mr; fi; + mr checkout; for a in .zsh .ssh; do @@ -67,7 +80,7 @@ for a in .zsh .ssh; do done; if [ ! -e .ssh/authorized_keys ]; then - (cd .ssh/; ln authorized_keys_default authorized_keys -s;) + (cd .ssh/; ln authorized_keys_default authorized_keys -s; ) fi; # do some cleanup; you might want to run git reset --hard in some @@ -76,8 +89,9 @@ fi; mr run git reset --soft origin/master mr up -# make sure mr and vcsh are in ~/bin if they are in ~/bin.bak +# move mr and vcsh to ~/bin if they are in ~/bin.bak for pkg in mr vcsh; do if [ -e ~/bin.bak/$pkg ]; then - cp ~/bin.bak/$pkg ~/bin/$pkg; + mv ~/bin.bak/$pkg ~/bin/; fi; +done;