Import Upstream version 1.02+dfsg

This commit is contained in:
luoyaoming 2024-05-06 21:49:25 +08:00
parent d35be34aee
commit 7c960e76ec
31 changed files with 2 additions and 2246 deletions

View File

@ -27,10 +27,6 @@ sub MY::install {
package MY;
my $script = shift->SUPER::install(@_);
print STDERR "Debian build: won't modify ParserDetails.ini when installing.\n";
print STDERR " (use update-perl-sax-parsers(8) instead.)\n";
return $script;
# Only modify existing ParserDetails.ini if user agrees
my $write_ini_ok = 0;

View File

@ -1,8 +0,0 @@
libxml-sax-perl for Debian
Please edit this to provide information specific to
this libxml-sax-perl Debian package.
(Automatically generated by debmake Version 4.3.1)
-- sufang <sufang@kylinos.cn> Fri, 02 Sep 2022 09:54:32 +0800

17
debian/changelog vendored
View File

@ -1,17 +0,0 @@
libxml-sax-perl (1.02-ok3) yangtze; urgency=medium
* Modify debian/control.
-- sufang <sufang@kylinos.cn> Fri, 16 Sep 2022 11:13:35 +0800
libxml-sax-perl (1.02-ok2) yangtze; urgency=medium
* Add parserdetails-debian.
-- sufang <sufang@kylinos.cn> Wed, 14 Sep 2022 14:48:33 +0800
libxml-sax-perl (1.02-ok1) yangtze; urgency=medium
* Build for openkylin.
-- sufang <sufang@kylinos.cn> Thu, 25 Aug 2022 14:54:03 +0800

2
debian/clean vendored
View File

@ -1,2 +0,0 @@
XML-SAX-Base/lib/XML/SAX/*.pm
t/lib/*

42
debian/control vendored
View File

@ -1,42 +0,0 @@
Source: libxml-sax-perl
Section: perl
Testsuite: autopkgtest-pkg-perl
Priority: optional
Maintainer: OpenKylin Developers <packaging@lists.openkylin.top>
Build-Depends: debhelper-compat (= 13)
Build-Depends-Indep: libxml-namespacesupport-perl <!nocheck>,
libxml-sax-base-perl <!nocheck>,
perl
Standards-Version: 4.6.0
Vcs-Browser: https://gitee.com/openkylin/libxml-sax-perl
Vcs-Git: https://gitee.com/openkylin/libxml-sax-perl.git
Homepage: https://metacpan.org/release/XML-SAX/
Rules-Requires-Root: no
Package: libxml-sax-perl
Architecture: all
Depends: ${misc:Depends},
${perl:Depends},
libxml-namespacesupport-perl,
libxml-sax-base-perl,
ucf
Recommends: libwww-perl,
libxml-sax-expat-perl
Description: Perl module for using and building Perl SAX2 XML processors
XML::SAX consists of several framework classes for using and
building Perl SAX2 XML parsers, filters, and drivers. It is designed
around the need to be able to "plug in" different SAX parsers to an
application without requiring programmer intervention. Those of you
familiar with the DBI will be right at home. Some of the designs
come from the Java JAXP specification (SAX part), only without the
javaness.
.
The package also contains a SAX parser, XML::SAX::PurePerl, but it
is considered too slow for serious use and is only provided as a
fallback parser. It is recommend XML::SAX::Expat (provided in
libxml-sax-expat-perl) instead.
.
The framework includes a Debian-specific script (called
update-perl-sax-parsers) to manage the ParserDetails.ini file. This
script is intended to be used in postinst and prerm package scripts to
(de)register parsers. See README.Debian for more info.

86
debian/copyright vendored
View File

@ -1,86 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: libxml-sax-perl
Source: <url://example.com>
#
# Please double check copyright with the licensecheck(1) command.
Files: Changes
MANIFEST
META.json
META.yml
Makefile.PL
README
lib/XML/SAX.pm
lib/XML/SAX/DocumentLocator.pm
lib/XML/SAX/Intro.pod
lib/XML/SAX/ParserFactory.pm
lib/XML/SAX/PurePerl.pm
lib/XML/SAX/PurePerl/DTDDecls.pm
lib/XML/SAX/PurePerl/DebugHandler.pm
lib/XML/SAX/PurePerl/DocType.pm
lib/XML/SAX/PurePerl/EncodingDetect.pm
lib/XML/SAX/PurePerl/Exception.pm
lib/XML/SAX/PurePerl/NoUnicodeExt.pm
lib/XML/SAX/PurePerl/Productions.pm
lib/XML/SAX/PurePerl/Reader.pm
lib/XML/SAX/PurePerl/Reader/NoUnicodeExt.pm
lib/XML/SAX/PurePerl/Reader/Stream.pm
lib/XML/SAX/PurePerl/Reader/String.pm
lib/XML/SAX/PurePerl/Reader/URI.pm
lib/XML/SAX/PurePerl/Reader/UnicodeExt.pm
lib/XML/SAX/PurePerl/UnicodeExt.pm
lib/XML/SAX/PurePerl/XMLDecl.pm
t/00basic.t
t/01known.t
t/10xmldecl1.t
t/11xmldecl2.t
t/12miscstart.t
t/13int_ent.t
t/14encoding.t
t/15element.t
t/16large.t
t/19pi.t
t/20factory.t
t/21saxini.t
t/30parse_file.t
t/40cdata.t
t/42entities.t
t/99cleanup.t
testfiles/utf-16.xml
testfiles/utf-16le.xml
Copyright: __NO_COPYRIGHT_NOR_LICENSE__
License: __NO_COPYRIGHT_NOR_LICENSE__
#----------------------------------------------------------------------------
# xml and html files (skipped):
# testfiles/06g.xml
# testfiles/06c.xml
# testfiles/06a.xml
# testfiles/xmltest.xml
# testfiles/koi8_r.xml
# testfiles/06e.xml
# testfiles/06d.xml
# testfiles/03b.xml
# testfiles/iso8859_2.xml
# testfiles/iso8859_1.xml
# testfiles/06b.xml
# testfiles/02a.xml
# testfiles/03a.xml
# testfiles/02b.xml
# testfiles/06f.xml
# testfiles/01.xml
# testfiles/04a.xml
#----------------------------------------------------------------------------
# Files marked as NO_LICENSE_TEXT_FOUND may be covered by the following
# license/copyright files.
#----------------------------------------------------------------------------
# License file: LICENSE
XML::SAX is dual licensed under the same terms as Perl itself.
.
This means at your choice, either the Perl Artistic License, or
the GNU GPL version 1 or higher.
.
(should we include the full text here?)
.

View File

@ -1,30 +0,0 @@
#!/bin/sh
## ----------------------------------------------------------------------
## debian/postinst : postinstallation script for libxml-foo-perl
## ----------------------------------------------------------------------
## This file is provided as an example for packages providing a
## SAX parser. See /usr/share/doc/libxml-sax-perl/README.Debian.gz .
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
set -e
## ----------------------------------------------------------------------
if [ "$1" = configure ]
then
if [ -n "$2" ] && dpkg --compare-versions "$2" lt x.x-x
then
update-perl-sax-parsers --remove XML::FOO
fi
update-perl-sax-parsers --add XML::FOO --priority 60
update-perl-sax-parsers --update
fi
## ----------------------------------------------------------------------
## automatically generated debhelper commands
#DEBHELPER#
exit 0
## ----------------------------------------------------------------------

View File

@ -1,25 +0,0 @@
#!/bin/sh
## ----------------------------------------------------------------------
## debian/prerm : preremoval script for libxml-foo-perl
## ----------------------------------------------------------------------
## This file is provided as an example for packages providing a
## SAX parser. See /usr/share/doc/libxml-sax-perl/README.Debian.gz .
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
set -e
## ----------------------------------------------------------------------
if [ "$1" = remove ]
then
update-perl-sax-parsers --remove XML::FOO
update-perl-sax-parsers --update
fi
## ----------------------------------------------------------------------
## automatically generated debhelper commands
#DEBHELPER#
exit 0
## ----------------------------------------------------------------------

View File

@ -1 +0,0 @@
/var/lib/libxml-sax-perl/ParserDetails.d

View File

@ -1 +0,0 @@
debian/examples/*

View File

@ -1 +0,0 @@
debian/update-perl-sax-parsers usr/bin

View File

@ -1 +0,0 @@
/etc/perl/XML/SAX/ParserDetails.ini /usr/share/perl5/XML/SAX/ParserDetails.ini

View File

@ -1 +0,0 @@
debian/update-perl-sax-parsers.8

View File

@ -1 +0,0 @@
# You must remove unused comment lines for the released package.

47
debian/postinst vendored
View File

@ -1,47 +0,0 @@
#!/bin/sh
## ----------------------------------------------------------------------
## debian/postinst : postinstallation script for libxml-sax-perl
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
set -e
## ----------------------------------------------------------------------
if [ "$1" = configure ]
then
[ -d /etc/perl/XML/SAX ] || mkdir --parents /etc/perl/XML/SAX
if command -v ucfr >/dev/null 2>&1
then
ucfr libxml-sax-perl /etc/perl/XML/SAX/ParserDetails.ini
fi
if [ -n "$2" ] && dpkg --compare-versions "$2" le 0.16-0.1
then
echo "Migrating the Perl SAX parser information directory."
# first, move /etc/perl/XML/SAX/ParserDetails.d/ under
# /var/lib/libxml-sax-perl
for i in /etc/perl/XML/SAX/ParserDetails.d/*
do
# the directory should never be missing or empty, but the [ ! -e ]
# construct handles an unexpanded glob just in case
[ ! -e "$i" ] || \
mv "$i" "/var/lib/libxml-sax-perl/ParserDetails.d/50-$(basename $i)"
done
[ ! -d /etc/perl/XML/SAX/ParserDetails.d ] || \
rmdir --ignore-fail-on-non-empty /etc/perl/XML/SAX/ParserDetails.d
# now downgrade XML::SAX::PurePerl priority by removing it first
update-perl-sax-parsers --remove XML::SAX::PurePerl
fi
update-perl-sax-parsers --add XML::SAX::PurePerl --priority 10
update-perl-sax-parsers --update
fi
## ----------------------------------------------------------------------
## automatically generated debhelper commands
#DEBHELPER#
exit 0
## ----------------------------------------------------------------------

31
debian/postrm vendored
View File

@ -1,31 +0,0 @@
#!/bin/sh
## ----------------------------------------------------------------------
## debian/postrm : postremoval script for libxml-sax-perl
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
set -e
## ----------------------------------------------------------------------
if [ "$1" = purge ]
then
rm -f /etc/perl/XML/SAX/ParserDetails.ini
rmdir --parents --ignore-fail-on-non-empty /etc/perl/XML/SAX
rm -rf /var/lib/libxml-sax-perl
if command -v ucf >/dev/null 2>&1
then
ucf --purge /etc/perl/XML/SAX/ParserDetails.ini
fi
if command -v ucfr >/dev/null 2>&1
then
ucfr --purge libxml-sax-perl /etc/perl/XML/SAX/ParserDetails.ini
fi
fi
## ----------------------------------------------------------------------
## automatically generated debhelper commands
#DEBHELPER#
exit 0
## ----------------------------------------------------------------------

34
debian/preinst vendored
View File

@ -1,34 +0,0 @@
#!/bin/sh
## ----------------------------------------------------------------------
## debian/preinst : preinstallation script for libxml-sax-perl
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
set -e
if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" le 0.16.0.1
then
# find out the md5sum of an unmodified ParserDetails.ini
[ -d /var/lib/libxml-sax-perl ] || mkdir --parents /var/lib/libxml-sax-perl
update-perl-sax-parsers --quiet --update --file - | md5sum - \
> /var/lib/libxml-sax-perl/ParserDetails.ini.md5sum
fi
if [ "$1" = "install" ] && [ -n "$2" ] && \
dpkg --compare-versions "$2" le 0.16.0.1
then
# upgrading from a removed but nonpurged state
# an unmodified ParserDetails.ini is an empty file
# we don't have update-perl-sax-parsers available yet
[ -d /var/lib/libxml-sax-perl ] || mkdir --parents /var/lib/libxml-sax-perl
md5sum - < /dev/null > /var/lib/libxml-sax-perl/ParserDetails.ini.md5sum
fi
## ----------------------------------------------------------------------
## automatically generated debhelper commands
#DEBHELPER#
exit 0
## ----------------------------------------------------------------------

22
debian/prerm vendored
View File

@ -1,22 +0,0 @@
#!/bin/sh
## ----------------------------------------------------------------------
## debian/prerm : preremoval script for libxml-sax-perl
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
set -e
## ----------------------------------------------------------------------
if [ "$1" = remove ]
then
update-perl-sax-parsers --remove XML::SAX::PurePerl
update-perl-sax-parsers --update
fi
## ----------------------------------------------------------------------
## automatically generated debhelper commands
#DEBHELPER#
exit 0
## ----------------------------------------------------------------------

3
debian/rules vendored
View File

@ -1,3 +0,0 @@
#!/usr/bin/make -f
%:
dh $@

View File

@ -1 +0,0 @@
3.0 (native)

View File

@ -1,2 +0,0 @@
t/
testfiles/

View File

@ -1,3 +0,0 @@
# these tests expect no ParserDetails.ini
t/20factory.t
t/21saxini.t

View File

@ -1,191 +0,0 @@
#!/usr/bin/perl
## ----------------------------------------------------------------------
## Debian update-perl-sax-parsers version 0.3
## ----------------------------------------------------------------------
## Copyright (C) 2001-2003 Ardo van Rangelrooij
## Copyright (C) 2007 Niko Tyni
##
## This is free software; see the GNU General Public Licence version 2
## or later for copying conditions. There is NO warranty.
## ----------------------------------------------------------------------
## ----------------------------------------------------------------------
use strict;
## ----------------------------------------------------------------------
use File::Spec;
use Getopt::Long;
use XML::SAX;
use XML::SAX::Debian;
use File::Temp qw(tempfile);
## ----------------------------------------------------------------------
$0 =~ m|[^/]+$|;
## ----------------------------------------------------------------------
my $name = $&;
## ----------------------------------------------------------------------
my $add = '';
my @directory = ();
my $file = '';
my $help = '';
my $quiet = '';
my $remove = '';
my $test = '';
my $update = '';
my $version = '';
my $ucf;
my $priority;
## ----------------------------------------------------------------------
if ( ! GetOptions(
'add=s' => \$add,
'directory=s' => \@directory,
'file=s' => \$file,
'help' => \$help,
'quiet' => \$quiet,
'remove=s' => \$remove,
'test' => \$test,
'update' => \$update,
'version' => \$version,
'priority=i' => \$priority,
'ucf=i' => \$ucf,
)
)
{
&usage;
exit 1;
}
## ----------------------------------------------------------------------
if ( $version )
{
&version;
exit 0;
}
## ----------------------------------------------------------------------
if ( $help )
{
&usage;
exit 0;
}
## ----------------------------------------------------------------------
print STDERR "$name: test mode - Perl SAX parsers file will not be updated\n"
if $test && ! $quiet;
## ----------------------------------------------------------------------
# default priority is 50 unless --directory was specified
# with --directory, default to 0 (no priority in the filenames)
$priority = (@directory ? 0 : 50) if not defined $priority;
## ----------------------------------------------------------------------
my $PARSER_DETAILS_DIR = "/var/lib/libxml-sax-perl/ParserDetails.d";
push( @directory, $PARSER_DETAILS_DIR) if ! @directory;
## ----------------------------------------------------------------------
# use ucf by default if --file is not specified
$ucf = ($file ? 0 : 1) if not defined $ucf;
## ----------------------------------------------------------------------
my $PARSER_DETAILS_FILE = "/etc/perl/XML/SAX/ParserDetails.ini";
$file = $PARSER_DETAILS_FILE if ! $file;
## ----------------------------------------------------------------------
unless (XML::SAX->can("_is_vendor_supplied")) {
print STDERR "$name: Non-vendor version of XML::SAX is installed.\n";
print STDERR "$name: Automatic registration of SAX parsers might not work.\n";
}
if ( $add )
{
print "$name: Registering Perl SAX parser $add with priority $priority...\n"
unless $quiet;
XML::SAX::Debian->save_parsers_debian( $add, $directory[0], $priority );
}
elsif ( $remove )
{
print "$name: Unregistering Perl SAX parser $remove with priority $priority...\n"
unless $quiet;
my $parser_file = $remove;
$parser_file = "${priority}-$parser_file" if $priority != 0;
$parser_file = File::Spec->catfile( $directory[0], $parser_file );
unlink( $parser_file );
}
elsif ( $update )
{
print "$name: Updating overall Perl SAX parser modules info file...\n"
unless $quiet;
my ($handle, $tmpfile);
if ($ucf) {
($handle, $tmpfile) = tempfile();
chmod 0644, $tmpfile or die("chmod $tmpfile: $!");
} else {
open( $handle, ">$file" )
|| die "Cannot write to $file: $!";
}
foreach my $directory ( @directory)
{
opendir( PARSER_DETAILS_DIR, $directory )
|| die "Cannot access $directory: $!";
my @files = sort readdir ( PARSER_DETAILS_DIR );
for my $parser_details ( @files )
{
next if $parser_details =~ /^\.\.?$/; # skip . and ..
open( PARSER_DETAILS, "$directory/$parser_details" )
|| die "Cannot read from $parser_details: $!";
while ( <PARSER_DETAILS> ) { print $handle $_; }
close( PARSER_DETAILS );
}
closedir( PARSER_DETAILS_DIR );
}
close( $handle );
if ($ucf) {
system("ucf", "--debconf-ok", "--sum-file", "/var/lib/libxml-sax-perl/ParserDetails.ini.md5sum", $tmpfile, $file);
unlink $tmpfile or die("unlink $tmpfile: $!");
}
}
## ----------------------------------------------------------------------
exit 0;
## ----------------------------------------------------------------------
sub usage
{
print STDERR <<END;
Usage:
$name <options> --add <parser_module>
$name <options> --remove <parser_module>
$name <options> --update
Options:
--directory Perl SAX parser module info file directory to be used
as target for 'add'/'remove' or as sources for 'update'
(default = '/var/lib/libxml-sax-perl/ParserDetails.d')
--priority The priority of the parser to add. The parser with the
highest priority is the default parser.
--file Perl SAX parser module info file to be updated
(default = '/etc/perl/XML/SAX/ParserDetails.ini')
--ucf X Forcibly disable (X == 0) or enable (X != 0) the use
of ucf with '--update'.
--help display this help text (usage)
--quiet be quiet
--test do not modify any files, enable debugging mode
--version display version number
END
}
## ----------------------------------------------------------------------
sub version
{
print "Debian $name version 0.4\n";
}
## ----------------------------------------------------------------------

View File

@ -1,177 +0,0 @@
.\" -*- nroff -*-
.\" ----------------------------------------------------------------------
.\" Copyright (c) 2001-2003 Ardo van Rangelrooij
.\"
.\" This is free software; see the GNU General Public Licence version 2
.\" or later for copying conditions. There is NO warranty.
.\" ----------------------------------------------------------------------
.\"
.\" ----------------------------------------------------------------------
.TH UPDATE-PERL-SAX-PARSERS 8 "Nov 2007" "0.3" "Debian"
.\"
.\" ----------------------------------------------------------------------
.SH NAME
update-perl-sax-parsers \- (de)register Perl SAX parser modules
.\"
.\" ----------------------------------------------------------------------
.SH SYNOPSIS
.B update-perl-sax-parsers
.RI [ options ]
.B --add
.I parser_module
.PP
.B update-perl-sax-parsers
.RI [ options ]
.B --remove
.I parser_module
.PP
.B update-perl-sax-parsers
.RI [ options ]
.B --update
.\"
.\" ----------------------------------------------------------------------
.SH DESCRIPTION
.B update-perl-sax-parsers
inserts, updates and removes individual Perl SAX parser module info
files in the directory
.I /var/lib/libxml-sax-perl/ParserDetails.d
and the overall Perl SAX parser modules info file
.IR /etc/perl/XML/SAX/ParserDetails.ini .
.\"
.\" ----------------------------------------------------------------------
.SH OPTIONS
.TP
.B --add
Adds the per-module info file for the indicated Perl SAX parser module
to the directory
.IR /var/lib/libxml-sax-perl/ParserDetails.d .
.TP
.B --remove
Removes the per-module info file for Perl SAX parser module from the
directory
.IR /var/lib/libxml-sax-perl/ParserDetails.d .
.TP
.B --update
updates the overall Perl SAX parser modules info file
.IR /etc/perl/XML/SAX/ParserDetails.ini .
The modules will be listed in an order of ascending priority. See
the PARSER PRIORITIES section below.
The file will be managed with
.B ucf(1) ,
unless the
.B --file
option is used. See also the
.B --ucf
option below.
.TP
.B --directory
When used with
.B --add
or with
.B --remove
indicates the ParserDetails.d directory to use for storing the
per-module Perl SAX parser module info file. When used one or more
times with
.B --update
indicates the ParserDetails.d directories to be used as source for
generating the ParserDetails.ini file. Default is
.IR /var/lib/libxml-sax-perl/ParserDetails.d .
.TP
.B --file
Indicates the ParserDetails.ini file up be updated. Default is
.IR /etc/perl/XML/SAX/ParserDetails.ini .
.TP
.B --priority XX
Specifies the priority of the SAX parser module to be added
removed. The priority will be encoded
to the filename of the ParserDetails.d entry. See the PARSER PRIORITIES
section below.
This option was added in version 0.3 of
.B update-perl-sax-parsers .
Use the value "0" to disable the encoding and match the behaviour
of earlier versions of the script.
The default priority value is 50, unless
.B --directory
was specified, in which case the default is 0 (disabled.)
.TP
.B --ucf X
Forcibly enable (X != 0) or disable (X = 0) of
.B ucf(1) .
By default,
.B ucf(1)
will be used to manage the ParserDetails.ini file when
.B --file
is
.IR not
specified.
.TP
.B --quiet
Prevents any diagnostic output.
.TP
.B --test
Prevents the modification of any files and enables debugging mode.
.TP
.B --version
Displays the version information and exits.
.TP
.B --help
Display the usage information and exits.
.\"
.\" ----------------------------------------------------------------------
.SH PARSER PRIORITIES
Starting with version 0.3 of
.B update-perl-sax-parsers ,
the parsers are assigned a priority value that is encoded into the names
of the files in the ParserDetails.d directory. Specifically, the file
name will be "XX-Some::Module", where XX denotes the priority and Some::Module
is the name of the parser module.
When
.B --update
is called, the parsers are listed in an order of ascending priority
into the
.IR ParserDetails.ini
file. The last parser in the file, ie. the one with the highest priority,
is the
.B default
XML::SAX parser.
Parsers with the same priority are sorted alphabetically by their name.
This is contrary to the behaviour of earlier versions, where the
sort order was undefined and depended on the underlying file system.
.\"
.\" ----------------------------------------------------------------------
.SH NOTE
Installing the original package from CPAN into /usr/local breaks the
Debian package, since the former is in Perl's @INC before the latter.
So, please don't do this.
If there's a new version of XML::SAX simply file a wishlist against
the Debian package and wait for the update.
.\"
.\" ----------------------------------------------------------------------
.SH "SEE ALSO"
.TP
/usr/share/doc/libxml-sax-perl/README.Debian
.\"
.\" ----------------------------------------------------------------------
.SH AUTHORS
Ardo van Rangelrooij <ardo@debian.org>
Niko Tyni <ntyni@iki.fi>
.\"
.\" ----------------------------------------------------------------------
.SH COPYRIGHT
Copyright \(co 2001-2003 Ardo van Rangelrooij
Copyright \(co 2007 Niko Tyni
.PP
This is free software; see the GNU General Public Licence version 2 or
later for copying conditions. There is
.I no
warranty.
.\"
.\" ----------------------------------------------------------------------

View File

@ -1,4 +0,0 @@
---
Archive: CPAN
Repository: https://github.com/grantm/xml-sax.git
Repository-Browse: https://github.com/grantm/xml-sax

3
debian/watch vendored
View File

@ -1,3 +0,0 @@
version=4
opts=dversionmangle=s/\+dfsg//,repacksuffix=+dfsg \
https://metacpan.org/release/XML-SAX .*/XML-SAX-v?@ANY_VERSION@@ARCHIVE_EXT@$

View File

@ -179,15 +179,6 @@ sub add_parser {
sub save_parsers {
my $class = shift;
### DEBIAN MODIFICATION
print "\n";
print "Please use 'update-perl-sax-parsers(8) to register this parser.'\n";
print "See /usr/share/doc/libxml-sax-perl/README.Debian.gz for more info.\n";
print "\n";
return $class; # rest of the function is disabled on Debian.
### END DEBIAN MODIFICATION
# get directory from wherever XML::SAX is installed
my $dir = $INC{'XML/SAX.pm'};
$dir = dirname($dir);
@ -221,10 +212,6 @@ sub do_warn {
warn(@_) unless $ENV{HARNESS_ACTIVE};
}
sub _is_vendor_supplied {
1;
}
1;
__END__

View File

@ -1,47 +0,0 @@
package XML::SAX::Debian;
use strict;
use warnings;
use base "XML::SAX";
use File::Spec ();
sub save_parsers_debian {
my $class = shift;
my ($parser_module,$directory, $priority) = @_;
# add parser
{
# We do not want load_parsers to complain.
local $ENV{HARNESS_ACTIVE} = 1;
$class->load_parsers("/nonexistent");
}
$class->add_parser($parser_module);
# get parser's ParserDetails file
my $file = $parser_module;
$file = "${priority}-$file" if $priority != 0;
$file = File::Spec->catfile($directory, $file);
chmod 0644, $file;
unlink($file);
open(my $fh, ">$file") ||
die "Cannot write to $file: $!";
foreach my $p (@{ $class->parsers }) {
print $fh "[$p->{Name}]\n";
foreach my $key (keys %{$p->{Features}}) {
print $fh "$key = $p->{Features}{$key}\n";
}
print $fh "\n";
}
print $fh "\n";
close $fh;
return $class;
}
1;

View File

@ -1,9 +1,6 @@
use Test::More;
use Test;
BEGIN { plan tests => 3 }
SKIP: {
skip 'Tests skipped due to Debian modifications', 3;
use XML::SAX;
ok(XML::SAX->save_parsers);
ok(XML::SAX->load_parsers);
ok(@{XML::SAX->parsers}, 0);
}

View File

@ -1,7 +1,7 @@
use Test;
BEGIN { plan tests => 1 }
use File::Spec;
skip('Test skipped due to Debian modifications', unlink(
ok(unlink(
File::Spec->catdir(qw(blib lib XML SAX ParserDetails.ini))),
1,
'delete ParserDetails.ini'

File diff suppressed because it is too large Load Diff