/usr/bin/xgfupdate is in xgridfit 2.3-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #!/bin/bash
XSLT_DIR=/usr/share/xml/xgridfit/utils/
#XSLT_DIR=/usr/local/share/xml/xgridfit/utils/
ACTION='2'
usage() {
cat <<Here-is-the-usage-text
usage: xgfupdate file
Options:
-h display this help message
-v 1|2 1=Update Xgridfit program to version 1.0
2=Update Xgridfit program to version 2.1
(default is 2)
Output is written to stdout. Redirect to a file as follows:
$ xgfupdate myfont.xgf > myfont-new.xgf
Here-is-the-usage-text
}
parseopts() {
while getopts "hv:" optname
do
case "$optname" in
"h")
usage
exit 0
;;
"v")
ACTION=$OPTARG
;;
"?")
usage 1>&2
exit 1
;;
":")
usage 1>&2
exit 1
;;
*)
echo "mysterious error"
usage 1>&2
exit 1
;;
esac
done
return $OPTIND
}
runscript() {
FNAME=$1
if [ -z "$FNAME" ]
then
usage 1>&2
exit 1
fi
if [ ! -f "$FNAME" ]
then
echo "File $FNAME does not exist" 1>&2
exit 1
fi
case $ACTION in
'1')
CMD="xsltproc ${XSLT_DIR}xgf-update.xsl $FNAME"
CMD=$CMD" | xmllint --format - | sed -f ${XSLT_DIR}add-blanks.sed"
eval $CMD
;;
'2')
CMD="xsltproc ${XSLT_DIR}xgf-add-namespace.xsl"
if grep -q "<xgridfit" $FNAME
then
CMD=$CMD" $FNAME"
else
echo "Warning: file \"$FNAME\" contains no <xgridfit> element. I will add one." 1>&2
CMD="xsltproc ${XSLT_DIR}add-xgridfit-element.xsl $FNAME | "$CMD" -"
fi
CMD=$CMD" | xmllint --format - | sed -f ${XSLT_DIR}add-blanks.sed"
eval $CMD
;;
esac
}
parseopts "$@"
argstart=$?
runscript "${@:$argstart}"
|