Ignore:
Timestamp:
Oct 25, 2008, 9:11:40 PM (16 years ago)
Author:
price
Message:

fix gen-files.sh to degrade gracefully to plain-old sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-base/files/lib/init/gen-files.sh

    r1211 r1303  
    11# Generates files from templates.
    22# Files should be named in an array variable GEN_FILES.
     3# If BASH_VERSION is null or unset, accepts only one file.
    34
    4 gen_files()
    5 {
    6   for f in "${GEN_FILES[@]}"; do
    7     mako-render $f.mako >$f
    8   done
    9 }
     5if [ $BASH_VERSION ]; then
     6  gen_files()
     7  {
     8    for f in "${GEN_FILES[@]}"; do
     9      mako-render "$f".mako >"$f"
     10    done
     11  }
     12else
     13  gen_files()
     14  {
     15    mako-render "$GEN_FILES".mako >"$GEN_FILES"
     16  }
     17fi
Note: See TracChangeset for help on using the changeset viewer.