From cfafc1d3bfb4b6e08ee81e88a4068f1114db66da Mon Sep 17 00:00:00 2001 From: Marcus Stoegbauer Date: Mon, 14 Jan 2013 15:47:04 +0000 Subject: [PATCH] Initial version --- ucinst.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 ucinst.sh diff --git a/ucinst.sh b/ucinst.sh new file mode 100755 index 0000000..7522d23 --- /dev/null +++ b/ucinst.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# $Id$ +# $URL$ + +# fixme: check svn +# fixme: check python + +BINSVNPATH=http://lys.is/svn/userconfig/trunk/python +COBINDIR=~/.tmp/userconfig +CONFSVNPATH=svn+ssh://lys.is/SVN/userconfig/trunk +COCONFDIR=~/.userconfig + +if [ -d "${COBINDIR}" ]; then + url=$(svn info "${COBINDIR}" 2>/dev/null | grep ^URL) + if [ "$url" = "URL: ${BINSVNPATH}" ]; then + svn update "${COBINDIR}" + else + count=1 + while [ -d "${COBINDIR}-${count}" ]; do + count=$(($count+1)) + done + mv "${COBINDIR}" "${COBINDIR}-${count}" || exit 1 + fi +fi + +svn checkout "${BINSVNPATH}" "${COBINDIR}" || exit 1 +cd "${COBINDIR}" || exit 1 +./setup.py install + +if [ -d "$COCONFDIR" ]; then + url=$(svn info "$COCONFDIR" 2>/dev/null | grep ^URL) + if [ "$url" = "URL: ${CONFSVNPATH}" ]; then + svn update ${COCONFDIR} + else + count=1 + while [ -d "${COCONFDIR}-${count}" ]; do + count=$(($count+1)) + done + mv "${COCONFDIR}" "${COCONFDIR}-${count}" || exit 1 + fi +fi + +svn checkout "${CONFSVNPATH}" "${COCONFDIR}" || exit 1 + +exit 0