From 56df66f39f58c61c97de4f3859ad583feb798aa6 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 25 Oct 2008 21:11:40 -0400 Subject: [PATCH] fix gen-files.sh to degrade gracefully to plain-old sh svn path=/trunk/packages/sipb-xen-base/; revision=1303 --- debian/changelog | 6 ++++++ files/lib/init/gen-files.sh | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6667537..171a543 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-base (8.29) unstable; urgency=low + + * gen-files.sh: degrade gracefully to plain-old sh + + -- Greg Price Sat, 25 Oct 2008 20:06:54 -0400 + sipb-xen-base (8.28) unstable; urgency=low * Factor out more common initscript code: diff --git a/files/lib/init/gen-files.sh b/files/lib/init/gen-files.sh index 61d0016..2baa994 100644 --- a/files/lib/init/gen-files.sh +++ b/files/lib/init/gen-files.sh @@ -1,9 +1,17 @@ # Generates files from templates. # Files should be named in an array variable GEN_FILES. +# If BASH_VERSION is null or unset, accepts only one file. -gen_files() -{ - for f in "${GEN_FILES[@]}"; do - mako-render $f.mako >$f - done -} +if [ $BASH_VERSION ]; then + gen_files() + { + for f in "${GEN_FILES[@]}"; do + mako-render "$f".mako >"$f" + done + } +else + gen_files() + { + mako-render "$GEN_FILES".mako >"$GEN_FILES" + } +fi -- 1.7.9.5