/usr/bin/gather_stx_titles is in stx2any 1.56-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 | #!/bin/sh
# This file is copyright (c) 2004,2005,2006 by Panu Kalliokoski
# and released under the license in ../LICENSE
BASE=/usr/share/stx2any
usage() {
cat $BASE/messages/gather_stx_titles.usage 1>&2
exit $1
}
while test -n "$1"; do
case "$1" in
-f) FROM_SUFFIX="$2"
shift
;;
-f*) FROM_SUFFIX=`echo $1 | cut -c3-`
;;
-t) TO_SUFFIX="$2"
shift
;;
-t*) TO_SUFFIX=`echo $1 | cut -c3-`
;;
-p) PREFIX="$2"
shift
;;
-p*) PREFIX=`echo $1 | cut -c3-`
;;
--help|-\?) usage 0 ;;
--version|-V)
cat $BASE/messages/version.msg
exit 0
;;
*) break
esac
shift
done
for i in $@; do
echo -n "define(\`@w_file_exists_"
echo -n "$i" | sed -e "s#$FROM_SUFFIX\$#$TO_SUFFIX#" -e "s#^$PREFIX/*##" | tr -d '\012\015'
echo "', t)dnl"
done
( cat << DEF
divert(-1)
define(\`w_quotewrap', \`\`\`\$1''')
define(\`w_makesubst',
\`patsubst(patsubst(\`\$1', \`$FROM_SUFFIX\$', \`$TO_SUFFIX'), \`^$PREFIX/*',)')
define(\`w_file', \`w_quotewrap(w_makesubst(w_real_file))')
define(\`w_title',
\`ifelse(\`\$1',,,\`divert(0)dnl')
\`define'(\`\`@w_title_of_''w_file, \`\`\$1'')\`dnl'
divert(-1)')
define(\`w_doc_id',
\`divert(0)dnl
\`define'(\`\`@w_filename_of_\$1'', w_file)\`dnl'
divert(-1)')
DEF
for i in $@; do
echo "define(\`w_real_file', \`$i')"
sed -f $BASE/common/header.sed $i
done
) | m4 || usage 1
|