From 6195215f83e8a77465fc04ed4fa8f62ce8e7974e Mon Sep 17 00:00:00 2001 From: Gabor Adam Toth Date: Thu, 16 Jun 2011 00:20:23 +0200 Subject: [PATCH] install.sh can be now run from the git repo --- .gitmodules | 3 +++ install.sh | 27 ++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2d33dcf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "psyclpc"] + path = psyclpc + url = git://git.tgbit.net/psyclpc diff --git a/install.sh b/install.sh index c5be9e3..28a62f1 100755 --- a/install.sh +++ b/install.sh @@ -172,7 +172,7 @@ echo "" echo "" echo "${hi}PSYCED INSTALLATION WIZARD${lo}" -if ! test -e data.tar +if ! test -e data.tar && ! test -d .git then cat </dev/null |wc -l` -gt 1 +if test -d .git +then + : +elif test `ls -1 ${driver}-*tar.${zip} 2>/dev/null |wc -l` -gt 1 then echo "${hi}ATTENTION:${lo} you've got more than one ${driver}-*tar.${zip}" echo "in this directory. Please tidy up before continuing!" @@ -1122,7 +1125,19 @@ fi echo "Extracting psyced data..." -if tar xf data.tar -C $BASE_DIR +if test -d .git +then + if ! test `realpath .` = $BASE_DIR + then + if git clone . $BASE_DIR && cp -a .git/config $BASE_DIR/.git + then + : + else + echo "Could not git clone. abort." + $exit + fi + fi +elif tar xf data.tar -C $BASE_DIR then : else @@ -1153,7 +1168,10 @@ then echo "" echo "${hi}COMPILING ${driver}${lo}" echo "" - if test `ls -d1 */src 2>/dev/null |wc -l` -lt 1; then + if test -d .git; then + git submodule init + git submodule update + elif test `ls -d1 */src 2>/dev/null |wc -l` -lt 1; then echo "" echo "Extracting $driver source..." echo "" @@ -1345,4 +1363,3 @@ then echo "" fi fi -