/usr/bin/db4-2-db5 is in publican 4.3.2-1.
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 | #!/usr/bin/perl -CDAS
eval 'exec /usr/bin/perl -CDAS -S $0 ${1+"$@"}'
if 0; # not running under some shell
use strict;
use warnings;
use Publican;
use XML::LibXML;
use XML::LibXSLT;
use Carp;
use Encode qw(is_utf8 decode_utf8 encode_utf8);
my $publican = Publican->new();
my $common_config = $publican->param('common_config');
my $xsl_file = $common_config . "/xsl/db4-upgrade.xsl";
# required for Windows
$xsl_file =~ s/"//g;
my $parser = XML::LibXML->new(
{ pedantic_parser => 0,
suppress_errors => 0,
suppress_warnings => 0,
line_numbers => 1,
expand_xinclude => 0,
expand_entities => 0,
recover_silently => 0,
}
);
my $xslt = XML::LibXSLT->new();
my @xml_files = dir_list( $publican->param('xml_lang'), '*.xml' );
foreach my $xml_file ( sort(@xml_files) ) {
print("Processing: $xml_file\n");
my $source;
eval { $source = $parser->parse_file("$xml_file"); };
if ($@) {
if ( ref($@) ) {
# handle a structured error (XML::LibXML::Error object)
carp(
maketext(
"FATAL ERROR: [_1]:[_2] in [_3] on line [_4]: [_5]",
$@->domain(),
$@->code(),
$@->file(),
$@->line(),
$@->message(),
)
);
next;
}
else {
croak( maketext( "FATAL ERROR: [_1]", $@ ) );
}
}
my $style_doc = $parser->parse_file($xsl_file);
my $stylesheet = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($source);
my $outfile;
open( $outfile, ">:encoding(UTF-8)", "$xml_file" )
|| croak( maketext( "Can't open ad file: [_1]", $@ ) );
print( $outfile decode_utf8( $stylesheet->output_string($results) ) );
close($outfile);
}
|