Changeset 4226

Show
Ignore:
Timestamp:
04/25/08 16:26:46 (2 months ago)
Author:
pmoura
Message:
Updated the "lgt2*.sh" shell scripts for POSIX compliance, removing dependencies on bash shell features.
Location:
trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/RELEASE_NOTES.txt

    r4224 r4226  
    114114    Added a "lgttxt.xsl" XSLT style-sheet and two shell scripts, "lgt2txt.sh"  
    115115    and "lgt2txt.js", for converting XML documenting files into text files. 
     116    Updated the "lgt2*.sh" shell scripts for POSIX compliance, removing  
     117    dependencies on bash shell features. 
    116118 
    117119    Updated the "lgtxml.xsl" XSLT style-sheet to ensure that the generated  
  • trunk/xml/lgt2html.sh

    r4102 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    154154done 
    155155 
    156 if [[ "$f_arg" != "" && "$f_arg" != "xhtml" && "$f_arg" != "html" ]] 
    157 then 
     156if [ "$f_arg" != "" ] && [ "$f_arg" != "xhtml" ] && [ "$f_arg" != "html" ] ; then 
    158157    echo "Error! Unsupported output format: $f_arg" 
    159158    usage_help 
    160159    exit 1 
    161 elif [ "$f_arg" != "" ] 
    162 then 
     160elif [ "$f_arg" != "" ] ; then 
    163161    format=$f_arg 
    164162fi 
    165163 
    166 if [[ "$d_arg" != "" && ! -d "$d_arg" ]] 
    167 then 
     164if [ "$d_arg" != "" ] && [ ! -d "$d_arg" ] ; then 
    168165    echo "Error! directory does not exists: $d_arg" 
    169166    usage_help 
    170167    exit 1 
    171 elif [ "$d_arg" != "" ] 
    172 then 
     168elif [ "$d_arg" != "" ] ; then 
    173169    directory=$d_arg 
    174170fi 
    175171 
    176 if [[ "$i_arg" != "" ]] 
    177 then 
     172if [ "$i_arg" != "" ] ; then 
    178173    index_file=$i_arg 
    179174fi 
    180175 
    181 if [[ "$t_arg" != "" ]] 
    182 then 
     176if [ "$t_arg" != "" ] ; then 
    183177    index_title=$t_arg 
    184178fi 
    185179 
    186 if [[ "$p_arg" != "" && "$p_arg" != "xsltproc" && "$p_arg" != "xalan" && "$p_arg" != "sabcmd" ]] 
    187 then 
     180if [ "$p_arg" != "" ] && [ "$p_arg" != "xsltproc" ] && [ "$p_arg" != "xalan" ] && [ "$p_arg" != "sabcmd" ] ; then 
    188181    echo "Error! Unsupported XSLT processor: $p_arg" 
    189182    usage_help 
    190183    exit 1 
    191 elif [ "$p_arg" != "" ] 
    192 then 
     184elif [ "$p_arg" != "" ] ; then 
    193185    processor=$p_arg 
    194186fi 
    195187 
    196 if [ "$format" = "xhtml" ] 
    197 then 
     188if [ "$format" = "xhtml" ] ; then 
    198189    xslt=$xhtml_xslt 
    199190else 
     
    201192fi 
    202193 
    203 if ! [[ -a "./logtalk.dtd" ]] 
    204 then 
     194if ! [ -e "./logtalk.dtd" ] ; then 
    205195    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    206196fi 
    207197 
    208 if ! [[ -a "./custom.ent" ]] 
    209 then 
     198if ! [ -e "./custom.ent" ] ; then 
    210199    cp "$LOGTALKUSER"/xml/custom.ent . 
    211200fi 
    212201 
    213 if ! [[ -a "./logtalk.xsd" ]] 
    214 then 
     202if ! [ -e "./logtalk.xsd" ] ; then 
    215203    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    216204fi 
    217205 
    218 if ! [[ -a "$directory/logtalk.css" ]] 
    219 then 
     206if ! [ -e "$directory/logtalk.css" ] ; then 
    220207    cp "$LOGTALKUSER"/xml/logtalk.css "$directory" 
    221208fi 
    222209 
    223 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    224 then 
     210if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    225211    echo 
    226212    echo "converting XML files..." 
  • trunk/xml/lgt2pdf.sh

    r4102 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    100100done 
    101101 
    102 if [[ "$f_arg" != "" && "$f_arg" != "a4" && "$f_arg" != "us" ]] 
    103 then 
     102if [ "$f_arg" != "" ] && [ "$f_arg" != "a4" ] && [ "$f_arg" != "us" ] ; then 
    104103    echo "Error! Unsupported output format: $f_arg" 
    105104    usage_help 
     
    110109fi 
    111110 
    112 if [[ "$d_arg" != "" && ! -d "$d_arg" ]] 
    113 then 
     111if [ "$d_arg" != "" ] && [ ! -d "$d_arg" ] ; then 
    114112    echo "Error! directory does not exists: $d_arg" 
    115113    usage_help 
    116114    exit 1 
    117 elif [ "$d_arg" != "" ] 
    118 then 
     115elif [ "$d_arg" != "" ] ; then 
    119116    directory=$d_arg 
    120117fi 
    121118 
    122 if [[ "$p_arg" != "" && "$p_arg" != "fop" && "$p_arg" != "xep" && "$p_arg" != "xinc" ]] 
    123 then 
     119if [ "$p_arg" != "" ] && [ "$p_arg" != "fop" ] && [ "$p_arg" != "xep" ] && [ "$p_arg" != "xinc" ] ; then 
    124120    echo "Error! Unsupported XSL-FO processor: $p_arg" 
    125121    usage_help 
    126122    exit 1 
    127 elif [ "$p_arg" != "" ] 
    128 then 
     123elif [ "$p_arg" != "" ] ; then 
    129124    processor=$p_arg 
    130125fi 
    131126 
    132 if [ "$format" = "a4" ] 
    133 then 
     127if [ "$format" = "a4" ] ; then 
    134128    xsl=$a4_xsl 
    135129else 
     
    137131fi 
    138132 
    139 if ! [[ -a "./logtalk.dtd" ]] 
    140 then 
     133if ! [ -e "./logtalk.dtd" ] ; then 
    141134    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    142135fi 
    143136 
    144 if ! [[ -a "./custom.ent" ]] 
    145 then 
     137if ! [ -e "./custom.ent" ] ; then 
    146138    cp "$LOGTALKUSER"/xml/custom.ent . 
    147139fi 
    148140 
    149 if ! [[ -a "./logtalk.xsd" ]] 
    150 then 
     141if ! [ -e "./logtalk.xsd" ] ; then 
    151142    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    152143fi 
    153144 
    154 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    155 then 
     145if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    156146    echo 
    157147    echo "converting XML files to PDF..." 
  • trunk/xml/lgt2txt.sh

    r4220 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    9494done 
    9595 
    96 if [[ "$d_arg" != "" && ! -d "$d_arg" ]] 
    97 then 
     96if [ "$d_arg" != "" ] && [ ! -d "$d_arg" ] ; then 
    9897    echo "Error! directory does not exists: $d_arg" 
    9998    usage_help 
    10099    exit 1 
    101 elif [ "$d_arg" != "" ] 
    102 then 
     100elif [ "$d_arg" != "" ] ; then 
    103101    directory=$d_arg 
    104102fi 
    105103 
    106 if [[ "$p_arg" != "" && "$p_arg" != "fop" && "$p_arg" != "xep" && "$p_arg" != "xinc" ]] 
    107 then 
     104if [ "$p_arg" != "" ] && [ "$p_arg" != "fop" ] && [ "$p_arg" != "xep" ] && [ "$p_arg" != "xinc" ] ; then 
    108105    echo "Error! Unsupported XSL-FO processor: $p_arg" 
    109106    usage_help 
    110107    exit 1 
    111 elif [ "$p_arg" != "" ] 
    112 then 
     108elif [ "$p_arg" != "" ] ; then 
    113109    processor=$p_arg 
    114110fi 
    115111 
    116 if ! [[ -a "./logtalk.dtd" ]] 
    117 then 
     112if ! [ -e "./logtalk.dtd" ] ; then 
    118113    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    119114fi 
    120115 
    121 if ! [[ -a "./custom.ent" ]] 
    122 then 
     116if ! [ -e "./custom.ent" ] ; then 
    123117    cp "$LOGTALKUSER"/xml/custom.ent . 
    124118fi 
    125119 
    126 if ! [[ -a "./logtalk.xsd" ]] 
    127 then 
     120if ! [ -e "./logtalk.xsd" ] ; then 
    128121    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    129122fi 
    130123 
    131 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    132 then 
     124if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    133125    echo 
    134126    echo "converting XML files to text files..." 
  • trunk/xml/lgt2xml.sh

    r4102 r4226  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## ================================================================ 
     
    140140done 
    141141 
    142 if [[ "$f_arg" != "" && "$f_arg" != "xhtml" && "$f_arg" != "html" ]] 
    143 then 
     142if [ "$f_arg" != "" ] && [ "$f_arg" != "xhtml" ] && [ "$f_arg" != "html" ] ; then 
    144143    echo "Error! Unsupported output format: $f_arg" 
    145144    usage_help 
    146145    exit 1 
    147 elif [ "$f_arg" != "" ] 
    148 then 
     146elif [ "$f_arg" != "" ] ; then 
    149147    format=$f_arg 
    150148fi 
    151149 
    152 if [[ "$i_arg" != "" ]] 
    153 then 
     150if [ "$i_arg" != "" ] ; then 
    154151    index_file=$i_arg 
    155152fi 
    156153 
    157 if [[ "$t_arg" != "" ]] 
    158 then 
     154if [ "$t_arg" != "" ] ; then 
    159155    index_title=$t_arg 
    160156fi 
    161157 
    162 if ! [[ -a "./logtalk.dtd" ]] 
    163 then 
     158if ! [ -e "./logtalk.dtd" ] ; then 
    164159    cp "$LOGTALKHOME"/xml/logtalk.dtd . 
    165160fi 
    166161 
    167 if ! [[ -a "./custom.ent" ]] 
    168 then 
     162if ! [ -e "./custom.ent" ] ; then 
    169163    cp "$LOGTALKUSER"/xml/custom.ent . 
    170164fi 
    171165 
    172 if ! [[ -a "./logtalk.xsd" ]] 
    173 then 
     166if ! [ -e "./logtalk.xsd" ] ; then 
    174167    cp "$LOGTALKHOME"/xml/logtalk.xsd . 
    175168fi 
    176169 
    177 if ! [[ -a "./logtalk.css" ]] 
    178 then 
     170if ! [ -e "./logtalk.css" ] ; then 
    179171    cp "$LOGTALKUSER"/xml/logtalk.css . 
    180172fi 
    181173 
    182 if ! [[ -a "./lgtxml.xsl" ]] 
    183 then 
     174if ! [ -e "./lgtxml.xsl" ] ; then 
    184175    cp "$LOGTALKUSER"/xml/lgtxml.xsl . 
    185176fi 
    186177 
    187 if [[ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ]] 
    188 then 
     178if [ `(ls *.xml | wc -l) 2> /dev/null` -gt 0 ] ; then 
    189179    echo 
    190180    echo "generating index file..."