From: Greg Price Date: Sun, 26 Oct 2008 01:11:40 +0000 (-0400) Subject: fix gen-files.sh to degrade gracefully to plain-old sh X-Git-Tag: sipb-xen-base/8.29^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-base.git/commitdiff_plain/56df66f39f58c61c97de4f3859ad583feb798aa6?ds=sidebyside fix gen-files.sh to degrade gracefully to plain-old sh svn path=/trunk/packages/sipb-xen-base/; revision=1303 --- 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