summaryrefslogtreecommitdiff
path: root/mrmovein
diff options
context:
space:
mode:
Diffstat (limited to 'mrmovein')
-rwxr-xr-xmrmovein82
1 files changed, 82 insertions, 0 deletions
diff --git a/mrmovein b/mrmovein
new file mode 100755
index 0000000..1a456ab
--- /dev/null
+++ b/mrmovein
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# move in script - set up a newly created account with sensible configuration
+#
+# Copyright 2011 Tobias Klauser <tklauser@distanz.ch>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Based on mrsetup by martin f. krafft which is:
+# Copyright 2008 martin f. krafft <madduck@madduck.net>
+#
+
+set -eu
+
+GIT_SERVER=ssh://git.distanz.ch
+GIT_REPOS='srv/git/git.distanz.ch'
+MR_CODE=$HOME/src/mr
+MR_REPO_URL=$GIT_SERVER/$GIT_REPOS/mr.git
+MR_DOTFILES_REPO_URL=$GIT_SERVER/$GIT_REPOS/dotfiles/mr.git
+DOTFILES=$HOME/src/dotfiles
+MR_DOTFILES=src/dotfiles/mr.git
+
+if [ ! -x "$(command -v git)" ]; then
+ echo "E: git is not installed." >&2
+ exit 2
+fi
+
+cd $HOME
+
+if [ -e .mrconfig ]; then
+ echo "E: .mrconfig already exists." >&2
+ exit 2
+fi
+
+if [ -d "$DOTFILES" ]; then
+ echo "E: $DOTFILES already exists." >&2
+ exit 3
+fi
+
+if [ -d .git ]; then
+ echo "E: .git already exists." >&2
+ exit 4
+fi
+
+if [ -d $MR_CODE ]; then
+ if [ -x $MR_CODE/mr ]; then
+ echo "W: $MR_CODE already exists, let's hope for the best." >&2
+ else
+ echo "E: $MR_CODE already exists but doesn't provide mr." >&2
+ exit 5
+ fi
+else
+ echo "I: cloning mr into $MR_CODE..."
+ mkdir -p ${MR_CODE%/*}
+ git clone --no-checkout $MR_REPO_URL $MR_CODE
+ (cd $MR_CODE && git checkout -b vcsh origin/vcsh)
+ echo
+fi
+
+cat << EOF > .mrconfig.movein
+[DEFAULT]
+include = cat $MR_CODE/lib/*
+
+[$MR_DOTFILES]
+checkout = git_fake_bare_checkout $MR_DOTFILES_REPO_URL ${MR_DOTFILES##*/} ../../../
+EOF
+
+cat << EOF > .mrtrust
+.mrconfig.movein
+EOF
+
+echo "I: initial .mrconfig:"
+cat .mrconfig.movein
+echo
+
+echo "I: cloning mr configuration..."
+$MR_CODE/mr --config .mrconfig.movein co
+echo
+
+#echo "I: setting up base..."
+#$MR_CODE/mr co
+
+exit 0
td>-0/+2 2011-10-31udf: Convert printks to pr_<level>Joe Perches1-19/+19 2011-10-10udf: Rename udf_warning to udf_warnJoe Perches1-1/+4 2011-10-10udf: Rename udf_error to udf_errJoe Perches1-3/+4 2011-10-10udf: Promote some debugging messages to udf_errorJoe Perches1-2/+7 2011-02-23udf: Convert UDF to new truncate calling sequenceJan Kara1-7/+5 2011-01-06udf: Move handling of uniqueID into a helper function and protect it by a s_a...Jan Kara1-0/+1 2011-01-06udf: Remove BKL from udf_update_inodeJan Kara1-1/+0 2011-01-06fs/udf: Add printf format/argument verificationJoe Perches1-0/+2 2010-08-09switch udf to ->evict_inode()Al Viro1-2/+1