]> git.donarmstrong.com Git - bin.git/commitdiff
switch new home directory to using mr, vcsh, and git
authorDon Armstrong <don@donarmstrong.com>
Thu, 19 Sep 2013 00:22:42 +0000 (17:22 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 19 Sep 2013 00:22:42 +0000 (17:22 -0700)
new_home_directory

index 6a5a8593dcec906ae80d5d378c0c7ef1514a1bde..f5e1f5e0816b80872241fb693a25cc4b620f3c99 100755 (executable)
@@ -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 -<<EOF> .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;