| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function docbook_expandLicenses { |
| |
| local INSTANCE=$1 |
| |
| |
| local DOCBOOK_MODELS="${TCAR_WORKDIR}/trunk/Documentation/Models/Docbook" |
| |
| |
| |
| |
| |
| |
| local LICENSES="${DOCBOOK_MODELS}/Default/Licenses/gpl.docbook \ |
| ${DOCBOOK_MODELS}/Default/Licenses/gfdl.docbook" |
| |
| |
| |
| local DOCTYPE=$(egrep '^<!DOCTYPE ' $INSTANCE | egrep '^<!DOCTYPE' \ |
| | gawk '{ print $2 }') |
| |
| |
| local BLOCK=$(cli_getTemporalFile "licenses.docbook") |
| |
| |
| BLOCK="<!-- Licenses -->\n" |
| BLOCK="${BLOCK}\n<part id=\"licenses\">\n" |
| BLOCK="${BLOCK}\n<title>`gettext "Licenses"`</title>\n" |
| BLOCK="${BLOCK}\n$(cat ${LICENSES} | sed -r '/<\?xml/,/]>/d')\n" |
| BLOCK="${BLOCK}\n</part>\n" |
| BLOCK="${BLOCK}\n<!-- Back matter -->\n" |
| |
| |
| |
| |
| |
| |
| |
| |
| sed -r -i -e "/<!-- Licenses -->/,/<!-- Back matter -->/c$(echo ${BLOCK})" $INSTANCE |
| |
| } |