docs-common/bin fdp-functions,NONE,1.1

Paul W. Frields (pfrields) fedora-docs-commits at redhat.com
Sun Jan 15 22:32:36 UTC 2006


Author: pfrields

Update of /cvs/docs/docs-common/bin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26205/docs-common/bin

Added Files:
	fdp-functions 
Log Message:
Draw out some functions that might be useful elsewhere


--- NEW FILE fdp-functions ---
#!/bin/sh
#
# Some common functions for use in other FDP scripts
#


FDPDIR=${FDPDIR:-".."}
FDPBINDIR="${FDPDIR}/docs-common/bin"
FDPPKGDIR="${FDPDIR}/docs-common/packaging"
RPMINFO=${RPMINFO:-"rpm-info.xml"}
XSLTPROC=${XSLTPROC:-xsltproc}
XMLFORMAT=${XMLFORMAT:-"${FDPBINDIR}/xmlformat" -f "${FDPBINDIR}/xmlformat-fdp.conf"}

get_all_workers()
{
    # Return list of workers, in format "email:wholename"
    ${XSLTPROC} "${FDPPKGDIR}/get-all-workers.xsl" \
	"$RPMINFO" | sed 's/^ \+//g' | grep -v '^$' | cat -n

}

get_worker_attribute()
{
    # Return an attribute for a specific worker
    if [ ! -z "$2" ]; then POS=$2 ; fi
    if [ ! -z "$1" ]; then ATT="$1" ; fi
    ${XSLTPROC} --stringparam att "$ATT" --param pos $POS \
	"${FDPPKGDIR}/get-worker.xsl" "$RPMINFO"
}

get_latest_revision()
{
    # Return latest revision for an optional role argument
    if [ ! -z "$1" ]; then
	OPTS="--stringparam role $1"
    fi
    ${XSLTPROC} ${OPTS} "${FDPPKGDIR}/doc-version.xsl" "$RPMINFO"
}




More information about the Fedora-docs-commits mailing list