remove dist-config - which was too specific for my case
authorJoerg Jaspert <joerg@debian.org>
Sat, 20 Apr 2013 23:17:19 +0000 (01:17 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sat, 20 Apr 2013 23:17:19 +0000 (01:17 +0200)
.zsh/functions/dist-config [deleted file]

diff --git a/.zsh/functions/dist-config b/.zsh/functions/dist-config
deleted file mode 100644 (file)
index 530f78f..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-# -*- sh -*-
-
-autoload colors ; colors
-
-plog() {
-    if [ $1 = "OK" ]; then
-        print "$fg[cyan]OK.${reset_color}"
-    else
-        print -n "$fg[green]$@...${reset_color} "
-    fi
-}
-
-# We can be executed to install ourself to the final destination
-if [[ $1 == "MAGIC" ]]; then
-    local anon=${2:-"true"}
-    plog "Installing basic dotfile support"
-
-    mkdir -p ${HOME}/bin
-    mkdir -p ${HOME}/.certs
-    for file in mr vcsh; do
-        cp bin/${file} ${HOME}/bin/${file}
-    done
-    cp .certs/ganneff.pem ${HOME}/.certs/ganneff.pem
-    plog "OK"
-    PATH=$HOME/bin:$PATH
-    answer="y"
-    if [[ -d "${HOME}/.config/vcsh/" ]]; then
-        answer="N"
-        echo "$fg[blue]Looks like there is a vcsh controlled config already."
-        echo "I can get rid of it and all its files before fetching the new one.${reset_color}"
-        echo "$fg[red]This will move ALL files from ANY vcsh controlled repository into '~/.oldhome'!${reset_color}"
-        vared -p "Want to do this it? [N/y] " answer
-        case ${answer} in
-            y|Y)
-                # Replace, get rid of old
-                plog "Moving files from vcsh"
-                mkdir ${HOME}/.oldhome
-                for delfile in $(vcsh list-tracked); do
-                    dirpart=${delfile:h}
-                    mkdir -p "${HOME}/.oldhome/${dirpart}"
-                    mv --target-directory="${HOME}/.oldhome/${dirpart}" ${HOME}/${delfile}
-                done
-                plog "OK"
-                mkdir -p "${HOME}/.oldhome/.config/"
-                mv --target-directory="${HOME}/.oldhome" "${HOME}/.config/vcsh/"
-                mv --target-directory="${HOME}/.oldhome" "${HOME}/.config/mr/"
-                mv --target-directory="${HOME}/.oldhome" "${HOME}/.mrconfig"
-                plog "OK"
-                answer="y"
-                read
-                ;;
-            n|N)
-                plog "Not deleting old vcsh directories, trying to continue with existing stuff\n"
-                ;;
-            *)
-                echo "Silly?"
-                return
-        esac
-    fi
-    if [[ $answer = "y" ]]; then
-        plog "Fetching mr config "
-        if [[ $anon = "true" ]]; then
-            plog "using the anonymous version\n"
-            GIT_SSL_CAINFO=${HOME}/.certs/ganneff.pem vcsh clone https://kosh.ganneff.de/git/mr.git
-            cd ${HOME}/.config/mr/config.d
-            for file in *.vcsh; do
-                rm ${file}
-                ln -s ../available.d/${file}-anon
-            done
-            plog "OK"
-        else
-            plog "using the ssh version\n"
-            vcsh clone git@git.ganneff.de:mr.git
-            plog "OK"
-        fi
-    fi
-    plog "Pulling all dotfile repositories\n"
-    cd ${HOME}
-    # The GIT_SSL_CAINFO variable isn't used when using the ssh version.
-    # But it also doesn't hurt, so leave it in, less code than an if clause
-    GIT_SSL_CAINFO=${HOME}/.certs/ganneff.pem mr update
-    plog "OK"
-    if [[ $anon = "true" ]]; then
-        plog "Setup ssl certs for all dotfile repositories\n"
-        mr run git config --local --add http.sslCAInfo ${HOME}/.certs/ganneff.pem
-        plog "OK"
-    fi
-    plog "Hard resetting dotfiles to ensure all files are there and the VCS versions\n"
-    mr run git reset --hard
-    plog "OK"
-
-    plog "Now sourcing parts of the new zsh config"
-    # Shut up "helper" function
-    function debug() {}
-    source ${HOME}/.zsh/zshenv.home
-    source ${HOME}/.zsh/00_Basics.zsh
-    source ${HOME}/.zsh/30_Options.zsh
-    autoload -U udh
-    plog "OK"
-    mkdir ${HOME}/tmp
-    plog "Running udh to setup the rest\n"
-    udh
-
-    unfunction plog
-    return
-fi
-
-{
-    # install my dotfiles in a remote host.
-    # needs makeself locally and git remotely.
-    local remote
-    local work
-    local start
-    remote=$1
-    anon=${2:-"true"}
-    work=$(mktemp -d)
-    start=$(pwd)
-    {
-        plog "Building archive..."
-        mkdir -p ${work}/bin
-        cp $(which mr) ${work}/bin
-        cp $(which vcsh) ${work}/bin
-        mkdir -p ${work}/.certs
-        cp ~/.TinyCA/Ganneff_CA/cacert.pem ${work}/.certs/ganneff.pem
-        cp ~/.zsh/functions/dist-config ${work}/dist-config
-        plog "OK"
-        plog "Building installer..."
-        makeself --gzip $work ${TMPDIR}/dotfiles-install.sh \
-            "$USER dotfiles" zsh ./dist-config MAGIC ${anon}
-        plog "OK"
-        [[ -z $1 ]] || {
-            plog "Remote install..."
-            scp $TMPDIR/dotfiles-install.sh ${remote}:
-            ssh -t $remote sh ./dotfiles-install.sh
-            plog "OK"
-        }
-    } always {
-        # Always clean up behind us
-        rm -rf $work
-        cd $start
-        unfunction plog
-    }
-}