From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- .../test/iostreams/bzip2-1.0.8/xmlproc.sh | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/xmlproc.sh (limited to 'src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/xmlproc.sh') diff --git a/src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/xmlproc.sh b/src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/xmlproc.sh new file mode 100644 index 000000000..16fe72b2d --- /dev/null +++ b/src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/xmlproc.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# see the README file for usage etc. +# +# ------------------------------------------------------------------ +# This file is part of bzip2/libbzip2, a program and library for +# lossless, block-sorting data compression. +# +# bzip2/libbzip2 version 1.0.8 of 13 July 2019 +# Copyright (C) 1996-2019 Julian Seward +# +# Please read the WARNING, DISCLAIMER and PATENTS sections in the +# README file. +# +# This program is released under the terms of the license contained +# in the file LICENSE. +# ---------------------------------------------------------------- + + +usage() { + echo ''; + echo 'Usage: xmlproc.sh -[option] '; + echo 'Specify a target from:'; + echo '-v verify xml file conforms to dtd'; + echo '-html output in html format (single file)'; + echo '-ps output in postscript format'; + echo '-pdf output in pdf format'; + exit; +} + +if test $# -ne 2; then + usage +fi +# assign the variable for the output type +action=$1; shift +# assign the output filename +xmlfile=$1; shift +# and check user input it correct +if !(test -f $xmlfile); then + echo "No such file: $xmlfile"; + exit; +fi +# some other stuff we will use +OUT=output +xsl_fo=bz-fo.xsl +xsl_html=bz-html.xsl + +basename=$xmlfile +basename=${basename//'.xml'/''} + +fofile="${basename}.fo" +htmlfile="${basename}.html" +pdffile="${basename}.pdf" +psfile="${basename}.ps" +xmlfmtfile="${basename}.fmt" + +# first process the xmlfile with CDATA tags +./format.pl $xmlfile $xmlfmtfile +# so the shell knows where the catalogs live +export XML_CATALOG_FILES=/etc/xml/catalog + +# post-processing tidy up +cleanup() { + echo "Cleaning up: $@" + while [ $# != 0 ] + do + arg=$1; shift; + echo " deleting $arg"; + rm $arg + done +} + +case $action in + -v) + flags='--noout --xinclude --noblanks --postvalid' + dtd='--dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd' + xmllint $flags $dtd $xmlfmtfile 2> $OUT + egrep 'error' $OUT + rm $OUT + ;; + + -html) + echo "Creating $htmlfile ..." + xsltproc --nonet --xinclude -o $htmlfile $xsl_html $xmlfmtfile + cleanup $xmlfmtfile + ;; + + -pdf) + echo "Creating $pdffile ..." + xsltproc --nonet --xinclude -o $fofile $xsl_fo $xmlfmtfile + pdfxmltex $fofile >$OUT $OUT $OUT $OUT $OUT $OUT $OUT $OUT $OUT