fix gen-files.sh to degrade gracefully to plain-old sh sipb-xen-base/8.29
authorGreg Price <price@mit.edu>
Sun, 26 Oct 2008 01:11:40 +0000 (21:11 -0400)
committerGreg Price <price@mit.edu>
Sun, 26 Oct 2008 01:11:40 +0000 (21:11 -0400)
svn path=/trunk/packages/sipb-xen-base/; revision=1303

debian/changelog
files/lib/init/gen-files.sh

index 6667537..171a543 100644 (file)
@@ -1,3 +1,9 @@
+sipb-xen-base (8.29) unstable; urgency=low
+
+  * gen-files.sh: degrade gracefully to plain-old sh
+
+ -- Greg Price <price@mit.edu>  Sat, 25 Oct 2008 20:06:54 -0400
+
 sipb-xen-base (8.28) unstable; urgency=low
 
   * Factor out more common initscript code:
 sipb-xen-base (8.28) unstable; urgency=low
 
   * Factor out more common initscript code:
index 61d0016..2baa994 100644 (file)
@@ -1,9 +1,17 @@
 # Generates files from templates.
 # Files should be named in an array variable GEN_FILES.
 # 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