From: xonotic Date: Thu, 18 Mar 2010 15:24:52 +0000 (+0100) Subject: rename all-download to all-update, make it way more clever X-Git-Tag: xonotic-v0.1.0preview~551 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=38fc744f0b23c905829bdae4a4fe33a2c32b9a5b;hp=a04e656e52a9b70cb4369e06e6c9cab1b41a1943 rename all-download to all-update, make it way more clever --- diff --git a/all-download.sh b/all-download.sh deleted file mode 100755 index e914ce0a..00000000 --- a/all-download.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - local) - base=ssh://gitolite - ;; - ssh) - base=ssh://xonotic@git.xonotic.org - ;; - git) - base=git://git.xonotic.org/xonotic - ;; - http) - base=http://git.xonotic.org/~xonotic - ;; - *) - echo "Usage: $0 transport, where transport might be local, ssh, git or http" - exit 1 - ;; -esac - -mkdir -p data -git clone "$base/xonotic-data.pk3dir" data/xonotic-data.pk3dir -git clone "$base/xonotic-maps.pk3dir" data/xonotic-maps.pk3dir -git clone "$base/xonotic-music.pk3dir" data/xonotic-music.pk3dir diff --git a/all-pull.sh b/all-pull.sh deleted file mode 100755 index aa6c43b0..00000000 --- a/all-pull.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -ex -git pull -for x in "`pwd`/data"/*.pk3dir/.git; do - cd "${x%/.git}" - git pull -done diff --git a/all-update.sh b/all-update.sh new file mode 100755 index 00000000..6a34004a --- /dev/null +++ b/all-update.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +base=`git config remote.origin.url` +base=${base%/xonotic.git} +d0=`pwd`/data +for d in data maps music; do + dd="xonotic-$d.pk3dir" + if [ -d "$d0/$dd" ]; then + cd "$d0/$dd" + git config remote.origin.url "$base/$dd.git" + git pull + cd "$d0" + else + git clone "$base/$dd.git" "$d0/dd" + fi +done