diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/format.pl | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/format.pl')
-rw-r--r-- | src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/format.pl | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/format.pl b/src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/format.pl new file mode 100644 index 000000000..2734dede1 --- /dev/null +++ b/src/boost/tools/boost_install/test/iostreams/bzip2-1.0.8/format.pl @@ -0,0 +1,68 @@ +#!/usr/bin/perl -w +# +# ------------------------------------------------------------------ +# 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 <jseward@acm.org> +# +# 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. +# ------------------------------------------------------------------ +# +use strict; + +# get command line values: +if ( $#ARGV !=1 ) { + die "Usage: $0 xml_infile xml_outfile\n"; +} + +my $infile = shift; +# check infile exists +die "Can't find file \"$infile\"" + unless -f $infile; +# check we can read infile +if (! -r $infile) { + die "Can't read input $infile\n"; +} +# check we can open infile +open( INFILE,"<$infile" ) or + die "Can't input $infile $!"; + +#my $outfile = 'fmt-manual.xml'; +my $outfile = shift; +#print "Infile: $infile, Outfile: $outfile\n"; +# check we can write to outfile +open( OUTFILE,">$outfile" ) or + die "Can't output $outfile $! for writing"; + +my ($prev, $curr, $str); +$prev = ''; $curr = ''; +while ( <INFILE> ) { + + print OUTFILE $prev; + $prev = $curr; + $curr = $_; + $str = ''; + + if ( $prev =~ /<programlisting>$|<screen>$/ ) { + chomp $prev; + $curr = join( '', $prev, "<![CDATA[", $curr ); + $prev = ''; + next; + } + elsif ( $curr =~ /<\/programlisting>|<\/screen>/ ) { + chomp $prev; + $curr = join( '', $prev, "]]>", $curr ); + $prev = ''; + next; + } +} +print OUTFILE $curr; +close INFILE; +close OUTFILE; +exit; |