diff options
-rw-r--r-- | bin/fdp-functions | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bin/fdp-functions b/bin/fdp-functions index 222a305..8a522b9 100644 --- a/bin/fdp-functions +++ b/bin/fdp-functions @@ -6,14 +6,24 @@ FDPDIR=${FDPDIR:-".."} + +# Convert ${FDPDIR} into an absolute pathname if needed +case "${FDPDIR}" in +/* ) + ;; +* ) + FDPDIR=${PWD}/${FDPDIR} + ;; +esac + FDPBINDIR="${FDPDIR}/docs-common/bin" FDPPKGDIR="${FDPDIR}/docs-common/packaging" -RPMINFO=${RPMINFO:-"rpm-info.xml"} +# NOTE TO PAUL: This is not a happy solution to defining ${RPMINFO} +RPMINFO=${RPMINFO:-"rpm-info-${LANG}.xml"} XSLTPROC=${XSLTPROC:-xsltproc} XMLFORMAT=${XMLFORMAT:-"${FDPBINDIR}/xmlformat"} XMLFOPTS=${XMLFOPTS:-"-f ${FDPBINDIR}/xmlformat-fdp.conf"} - get_all_workers() { # Return list of workers, in format "email:wholename" @@ -89,10 +99,14 @@ apply_po() { if [ $# -ne 1 ]; then echo "usage: apply_po filename.xml">&2 fi - POFILE=`/bin/basename "$1" .xml`.po + POFILE=`/usr/bin/dirname "$1"`/`/bin/basename "$1" .xml`.po if [ ! -f "${POFILE}" ]; then echo "apply_po: file '${POFILE}' not found." >&2 return 1 fi po2xml "$1" "${POFILE}" } + +prettyprint() { + ${XMLFORMAT} ${XMLFOPTS} $@ +} |