From 9a7811aa929b2b964fb3b28d6f6b30f3237cb128 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Mon, 25 Jun 2012 13:33:36 +0200 Subject: [PATCH] * Add 'set -e' to all scm test setup scripts, to catch errors as early as possible * Fix git setup --- tests/jobs/bzr-update.sh | 1 + tests/jobs/git-update.sh | 9 +++++++-- tests/jobs/hg-update.sh | 1 + tests/jobs/svn-update.sh | 5 +++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/jobs/bzr-update.sh b/tests/jobs/bzr-update.sh index f269fe3f..018b507f 100755 --- a/tests/jobs/bzr-update.sh +++ b/tests/jobs/bzr-update.sh @@ -1,4 +1,5 @@ #! /bin/sh +set -e repo="$1" STATE_FILE=$(pwd)/.bzr-state diff --git a/tests/jobs/git-update.sh b/tests/jobs/git-update.sh index 10967d3a..eec0ee9d 100755 --- a/tests/jobs/git-update.sh +++ b/tests/jobs/git-update.sh @@ -1,7 +1,9 @@ #! /bin/sh # This script is used both by git & deepgit checks. +set -e repo=git-repo +export HOME=$(pwd) STATE_FILE=$(pwd)/.git-state if test -e $STATE_FILE; then state=$(cat $STATE_FILE) @@ -10,15 +12,18 @@ else state=0; fi +echo "STATE: $state" case $state in - (0) echo "::Create repo. -- continue -- updated::" + (0) echo "::Create repo. -- continue -- updated::" git init $repo cd $repo + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + touch foo git add foo git commit -m "Add foo" git tag -a -m "First Tag." tag0 - git checkout -b master HEAD ;; (1) echo "::Create new commit. -- continue -- updated::" cd $repo diff --git a/tests/jobs/hg-update.sh b/tests/jobs/hg-update.sh index 9d1a67e0..aac101e5 100755 --- a/tests/jobs/hg-update.sh +++ b/tests/jobs/hg-update.sh @@ -1,4 +1,5 @@ #! /bin/sh +set -e repo="$1" STATE_FILE=$(pwd)/.hg-state diff --git a/tests/jobs/svn-update.sh b/tests/jobs/svn-update.sh index 65b4ae13..b839b712 100755 --- a/tests/jobs/svn-update.sh +++ b/tests/jobs/svn-update.sh @@ -1,6 +1,7 @@ #! /bin/sh +set -e -repo="$1" +repo=svn-repo STATE_FILE=$(pwd)/.svn-state if test -e $STATE_FILE; then state=$(cat $STATE_FILE) @@ -12,7 +13,7 @@ fi case $state in (0) echo "::Create repo. -- continue -- updated::" svnadmin create svn-repo - svn co $repo svn-checkout + svn co file://$PWD/$repo svn-checkout touch svn-checkout/svn-file svn add svn-checkout/svn-file svn commit -m "add svn file" svn-checkout/svn-file