From 90ddacce842b68982b97cc111b7d6d5a23381be8 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 18 Sep 2013 17:22:42 -0700 Subject: [PATCH] switch new home directory to using mr, vcsh, and git --- new_home_directory | 59 ++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/new_home_directory b/new_home_directory index 6a5a859..f5e1f5e 100755 --- a/new_home_directory +++ b/new_home_directory @@ -1,43 +1,40 @@ #!/bin/sh # makes a new home directory; defaults to one that does not use ssh -SVN_BASE=http://svn.donarmstrong.com/don/trunk +GIT_BASE=http://git.donarmstrong.com/ + +if [ "$1" = "ssh" ]; then + GIT_BASE=git+ssh://git.donarmstrong.com/srv/git/ +fi; -# check out bin and lib cd ~; -svn co $SVN_BASE/bin -svn co $SVN_BASE/lib -# check out the .home modules -mkdir .home_modules; -( - cd .home_modules; - svn co $SVN_BASE/home_modules/base; - for module in $@; do - svn co $SVN_BASE/home_modules/$module; - done; -) -# make a home backup directory -mkdir home_backup; -for a in .wgetrc .svn .sversionrc .subversion .bash_profile .bash_logout .bashrc .ssh; do - if [ -e $a ]; then - mv $a home_backup/; +for pkg in mr vcsh; do + if ! which $pkg >/dev/null 2>&1; then + 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 . + ); + 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 + fi; fi; done; -mkdir .sa.d; -ln -s ~/.home_modules/*/sa_* .sa.d/; -# run the appropriate command to set the symlinks correctly -~/bin/sa --hooks-only update -cat -< .sa.d/sa_local -~/bin -~/lib -EOF -# move back the .ssh stuff -if [ -e home_backup/.ssh ]; then - cp -f home_backup/.ssh/* .ssh/; + +if [ "$1" = "ssh" ]; then + mkdir -p .config/; + (cd .config/; + git checkout git+ssh://git.donarmstrong.com/srv/git_private/mr.git + ); + mr --config ~/.config/mr/config.d/base.git checkout +else + vcsh clone $GIT_BASE/mr.git mr; fi; -~/bin/sa update; -# if there isn't already a .ssh/authorized_keys, symlink authorized_keys_default to it +mr checkout; if [ ! -e .ssh/authorized_keys ]; then (cd .ssh/; ln authorized_keys_default authorized_keys -s;) fi; -- 2.39.2