From 30600052dc7c9c15a0639f3417d75b70e36cef81 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 17 May 2010 12:04:46 +0200 Subject: [PATCH 1/1] Make sure tests work with dash as well. If dash is used as /bin/sh then $RANDOM isn't set. Running all the runit.sh scripts using zsh as well addresses this issue, also check for $RANDOM in framework.sh so we exit before running into obscure error messages. --- autoconfig/runit.sh | 2 +- framework.sh | 6 ++++++ grml2hd/runit.sh | 2 +- grml2usb/runit.sh | 2 +- lvm/runit.sh | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/autoconfig/runit.sh b/autoconfig/runit.sh index 99e2799..a10e732 100755 --- a/autoconfig/runit.sh +++ b/autoconfig/runit.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/zsh . $FRAMEWORK diff --git a/framework.sh b/framework.sh index ca18dba..292820b 100644 --- a/framework.sh +++ b/framework.sh @@ -35,6 +35,12 @@ trap bailout QUIT INT EXIT COMMON_PORT=0 STATUS_PORT=0 +# $RANDOM is not set in dash +if [ -z "$RANDOM" ] ; then + echo "Variable \$RANDOM not set, can not choose random port. Exiting.">&2 + bailout +fi + while [ $COMMON_PORT -lt 1024 ] || [ $STATUS_PORT -lt 1024 ] ; do COMMON_PORT=$RANDOM STATUS_PORT=$RANDOM diff --git a/grml2hd/runit.sh b/grml2hd/runit.sh index db99029..75ef364 100755 --- a/grml2hd/runit.sh +++ b/grml2hd/runit.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/zsh for i in grub lilo ; do PARENT=$$ $i/runit.sh diff --git a/grml2usb/runit.sh b/grml2usb/runit.sh index b787e69..0c8e7ff 100755 --- a/grml2usb/runit.sh +++ b/grml2usb/runit.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/zsh . $FRAMEWORK diff --git a/lvm/runit.sh b/lvm/runit.sh index e72269a..8034380 100755 --- a/lvm/runit.sh +++ b/lvm/runit.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/zsh . $FRAMEWORK -- 2.1.4