debian/0000775000000000000000000000000012011262723007164 5ustar debian/patches/0000775000000000000000000000000012011262672010616 5ustar debian/patches/implement-local-dirname0000664000000000000000000000243612011262661015243 0ustar Description: Copy DirName function from doc-base and use that instead of dirname() Author: Stéphane Graber Forwarded: no Last-Update: 2012-08-10 --- libxml-sax-perl-0.99+dfsg.orig/SAX.pm +++ libxml-sax-perl-0.99+dfsg/SAX.pm @@ -12,7 +12,6 @@ use Exporter (); @EXPORT_OK = qw(Namespaces Validation); -use File::Basename qw(dirname); use File::Spec (); use Symbol qw(gensym); use XML::SAX::ParserFactory (); # loaded for simplicity @@ -44,6 +43,13 @@ http://xml.org/sax/features/validation = =cut +sub _DirName { # {{{ + my @p = split '/', $_[0]; + return (join '/', @p[0..($#p-1)]) if $#p > 1; + return '/' if substr ($_[0], 0, 1) eq '/'; + return '.'; +} # }}} + sub load_parsers { my $class = shift; my $dir = shift; @@ -54,7 +60,7 @@ sub load_parsers { # get directory from wherever XML::SAX is installed if (!$dir) { $dir = $INC{'XML/SAX.pm'}; - $dir = dirname($dir); + $dir = _DirName($dir); } my $fh = gensym(); @@ -190,7 +196,7 @@ sub save_parsers { # get directory from wherever XML::SAX is installed my $dir = $INC{'XML/SAX.pm'}; - $dir = dirname($dir); + $dir = _DirName($dir); my $file = File::Spec->catfile($dir, "SAX", PARSER_DETAILS); chmod 0644, $file; debian/patches/skip-test-with-nonfree-file0000664000000000000000000000114611762206614016014 0ustar Description: Skip a test depending on a non-free input file (testfiles/xmltest.xml). Bugs: #452872 --- a/t/16large.t +++ b/t/16large.t @@ -1,4 +1,4 @@ -use Test; +use Test::More; BEGIN { plan tests => 3 } use XML::SAX::PurePerl; use XML::SAX::PurePerl::DebugHandler; @@ -9,8 +9,10 @@ my $parser = XML::SAX::PurePerl->new(Handler => $handler); ok($parser); +SKIP: { +skip "Non-free test input is not present in the Debian version", 1; my $time = time; $parser->parse_uri("testfiles/xmltest.xml"); warn("parsed ", -s "testfiles/xmltest.xml", " bytes in ", time - $time, " seconds\n"); ok(1); - +} # SKIP debian/patches/pod-spelling0000664000000000000000000000171111762206614013144 0ustar Author: gregor herrmann Description: fix spelling errors in POD Origin: vendor Forwarded: no --- a/SAX/Intro.pod +++ b/SAX/Intro.pod @@ -82,7 +82,7 @@ SAX works very similarly to XML::Parser's default callback method, except it has one major difference: rather than setting individual -callbacks, you create a new class in which to recieve the callbacks. +callbacks, you create a new class in which to receive the callbacks. Each callback is called as a method call on an instance of that handler class. An example will best demonstrate this: @@ -242,7 +242,7 @@ =head2 characters -The characters callback may be called in serveral circumstances. The +The characters callback may be called in several circumstances. The most obvious one is when seeing ordinary character data in the markup. But it is also called for text in a CDATA section, and is also called in other situations. A SAX parser has to make no guarantees whatsoever debian/patches/series0000664000000000000000000000014712011262672012035 0ustar skip-test-with-nonfree-file charset-decoding parserdetails-debian pod-spelling implement-local-dirname debian/patches/charset-decoding0000664000000000000000000000151411762206614013753 0ustar Description: Fix charset decoding in the PurePerl module (#405186) Author: Niko Tyni Date: Sun, 04 Nov 2007 20:46:58 +0200 --- a/SAX/PurePerl/Productions.pm +++ b/SAX/PurePerl/Productions.pm @@ -39,7 +39,7 @@ # can't do this one without unicode # $CombiningChar = qr/^$/msx; - $NameChar = qr/^ (?: $BaseChar | $Digit | [._:-] | $Extender )+ $/x; + $NameChar = qr/ (?: $BaseChar | $Digit | [._:-] | $Extender )+ /x; PERL die $@ if $@; } --- a/SAX/PurePerl.pm +++ b/SAX/PurePerl.pm @@ -677,7 +677,7 @@ return unless length($name); - $name =~ /$NameChar/o or $self->parser_error("Name <$name> does not match NameChar production", $reader); + $name =~ /^$NameChar+$/o or $self->parser_error("Name <$name> does not match NameChar production", $reader); return $name; } debian/patches/parserdetails-debian0000664000000000000000000000650511762206614014637 0ustar Description: The Debian way of handling ParserDetails.ini: use update-perl-sax-parsers(8) instead. * SAX.pm: the meat of the modifications + add XML::SAX->save_parsers_debian(), used by update-perl-sax-parsers + disable XML::SAX->save_parsers() with a helpful error message for users trying to install SAX parsers manually from CPAN * Makefile.PL: Don't try to modify ParserDetails.ini when building the package * t/01known.t, t/99cleanup.t: Skip tests related to XML::SAX->save_parsers() Author: Originally by Ardo van Rangelrooij Author: Cleanups and quilt conversion by Niko Tyni Author: Ansgar Burchardt (XML::SAX::Debian) --- a/t/01known.t +++ b/t/01known.t @@ -1,6 +1,9 @@ -use Test; +use Test::More; 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); +} --- a/t/99cleanup.t +++ b/t/99cleanup.t @@ -1,7 +1,7 @@ use Test; BEGIN { plan tests => 1 } use File::Spec; -ok(unlink( +skip('Test skipped due to Debian modifications', unlink( File::Spec->catdir(qw(blib lib XML SAX ParserDetails.ini))), 1, 'delete ParserDetails.ini' --- a/Makefile.PL +++ b/Makefile.PL @@ -16,6 +16,10 @@ 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; --- a/SAX.pm +++ b/SAX.pm @@ -179,6 +179,15 @@ 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); @@ -212,6 +221,10 @@ warn(@_) unless $ENV{HARNESS_ACTIVE}; } +sub _is_vendor_supplied { + 1; +} + 1; __END__ --- /dev/null +++ b/SAX/Debian.pm @@ -0,0 +1,47 @@ +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; debian/copyright0000664000000000000000000000373411762206614011137 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Contact: Grant McLean, grantm@cpan.org Source: http://search.cpan.org/dist/XML-SAX/ Upstream-Name: XML-SAX Comment: Upstream sources are repackaged to remove a file with non-free licensing/copyright: + testcases/xmltest.xml (See #452872) Repackaging is done via debian/repack.stub and can be replayed using either "debian/rules get-orig-source" or "uscan -f". Files: * Copyright: Matt Sergeant, matt@sergeant.org License-Alias: Perl License: Artistic or GPL-1+ Files: XML/SAX/*.pm XML/SAX/DTDDecls.pm XML/SAX/EncodingDetect.pm XML/SAX/Productions.pm XML/SAX/Reader.pm XML/SAX/Reader/String.pm XML/SAX/Reader/UnicodeExt.pm Copyright: Grant McLean, grantm@cpan.org License: Artistic or GPL-1+ Files: XML/SAX/DocumentLocator.pm Copyright: Matt Sergeant, matt@sergeant.org License: Artistic or GPL-1+ Files: debian/* Copyright: 2002-2003, Ardo van Rangelrooij 2004, Jay Bonci 2006, Gunnar Wolf 2007, Robert S. Edmonds 2007-2008, Niko Tyni 2009, gregor herrmann 2009, Franck Joncourt 2009, Antonio Radici 2011-2012, Florian Schlichting License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian systems, the complete text of version 1 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-1'. debian/examples/0000775000000000000000000000000011762206614011013 5ustar debian/examples/libxml-foo-perl.postinst0000664000000000000000000000204111762206614015625 0ustar #!/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 ## ---------------------------------------------------------------------- debian/examples/libxml-foo-perl.prerm0000664000000000000000000000161311762206614015073 0ustar #!/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 ## ---------------------------------------------------------------------- debian/postinst0000664000000000000000000000336011762206614011005 0ustar #!/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 which 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 ## ---------------------------------------------------------------------- debian/repack.stub0000775000000000000000000000325111762206614011345 0ustar #!/bin/sh : <<=cut =pod =head1 NAME repack.stub - script to repack upstream tarballs from uscan =head1 INSTRUCTIONS put this in debian/repack.stub and add "debian sh debian/repack.stub" to the end of the line in debian/watch. you will also need to add a version mangle to debian/watch. then create a debian/repack.local. this is a shell script that is sources under "set -e", so be careful to check returns codes. =head1 FUNCTIONS =over 4 =item rm rm is replaced by a function that does some magic ("rm -rv" by default), but also changes MANIFEST if $MANIFEST is 1 =item mv mv is replaced by a function that just does mv (by default), but also changes MANIFEST if $MANIFEST is 1 =item requires_version requires_version is there for future usage for requiring certain versions of the script =back =head1 VARIABLES =over 4 =item SUFFIX defaults to +dfsg what to append to the upstream version =item RM_OPTS defaults to -vrf options to pass to rm =item MANIFEST defaults to 0, set to 1 to turn on. this will manipulate MANIFEST files in CPAN tarballs. =item UP_BASE this is the directory where the upstream source is. =back =cut if [ -z "$REPACK_SH" ]; then if [ -f ../../scripts/repack.sh ]; then REPACK_SH=../../scripts/repack.sh fi if [ -z "$REPACK_SH" ] && which repack.sh > /dev/null; then REPACK_SH=$(which repack.sh) fi fi if [ ! -f "$REPACK_SH" ]; then echo "Couldn't find a repack.sh. please put it in your PATH, put it at ../../scripts/repack.sh, or put it somewhere else and set the REPACK_SH variable" echo "You can get it from http://svn.debian.org/viewsvn/pkg-perl/scripts/repack.sh" exit 1 fi exec "$REPACK_SH" "$@" debian/libxml-sax-perl.dirs0000664000000000000000000000005111762206614013074 0ustar /var/lib/libxml-sax-perl/ParserDetails.d debian/rules0000775000000000000000000000024211762206614010253 0ustar #!/usr/bin/make -f %: dh $@ get-orig-source: # debian/repack.stub: delete the file testfiles/xmltest.xml chmod 755 debian/repack.stub uscan --rename --force debian/source/0000775000000000000000000000000011762206614010475 5ustar debian/source/format0000664000000000000000000000001411762206614011703 0ustar 3.0 (quilt) debian/clean0000664000000000000000000000004611762206614010202 0ustar XML-SAX-Base/lib/XML/SAX/*.pm t/lib/* debian/libxml-sax-perl.links0000664000000000000000000000011711762206614013256 0ustar /etc/perl/XML/SAX/ParserDetails.ini /usr/share/perl5/XML/SAX/ParserDetails.ini debian/watch0000664000000000000000000000025211762206614010225 0ustar version=3 opts=dversionmangle=s/\+dfsg// \ http://search.cpan.org/dist/XML-SAX .*/XML-SAX-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ \ debian sh debian/repack.stub debian/compat0000664000000000000000000000000211762206614010373 0ustar 8 debian/README.Debian0000664000000000000000000001702511762206614011243 0ustar libxml-sax-perl for Debian ========================== This is the Debian package of the Perl XML::SAX module which is the base package for the Perl SAX parser modules. Background ---------- A Perl SAX parser module is expected to register itself with the XML::SAX module during installation using a code snippet in the Makefile.PL for that module (see XML::SAX(3pm) for all the details). This latter module uses a file called 'ParserDetails.ini' as register which is created in the same directory where the XML::SAX modules are installed. Unfortunately, this registration does not work out of the box on a Debian system: The `make install` using the Makefile generated from the Makefile.PL mentioned above is run by the package maintainer on the system where the Debian package is build, while for the above described registration to work is has to run on the user's system. Perl SAX parser module registration -- the Debian way ----------------------------------------------------- On a Debian system the registration of the parser modules is done using a script called `update-perl-sax-parsers` in two steps: 1. Store the Perl SAX parser module info in a per-module file in a directory called 'ParserDetails.d'. 2. Generate the file 'ParserDetails.ini' by concatenating the contents of the files in the 'ParserDetails.d' directory. The deregistration of a parser module is also done in two steps: 1. Remove the per-module file for the Perl SAX parser module from the directory 'ParserDetails.d'. 2. Generate the file 'ParserDetails.ini' by concatenating the contents of the remaining files in the 'ParserDetails.d' directory. This script uses the directory '/var/lib/libxml-sax-perl/ParserDetails.d' and the file '/etc/perl/XML/SAX/ParserDetails.ini' by default. To keep the default behaviour of the XML::SAX module the file '/usr/share/perl5/XML/SAX/ParserDetails.ini' is symlinked to the file '/etc/perl/XML/SAX/ParserDetails.ini'. The file '/etc/perl/XML/SAX/ParserDetails.ini' is managed with ucf(1) to ensure that local changes are not accidentally overwritten. If you choose to keep a locally modified file but change your mind later, you can get update-perl-sax-parsers to overwrite your modified file by running 'ucf --purge '/etc/perl/XML/SAX/ParserDetails.ini' first. Support for Debian packages with Perl SAX parser modules -------------------------------------------------------- Each Debian package containing one or more Perl SAX parser modules needs to register these modules using the `update-perl-sax-parsers` script. This is done by putting the appropriate invocations of this script in the postinst and the prerm scripts of that package. Starting with libxml-sax-perl version 0.16+dfsg-1, the 'update-perl-sax-parsers' script supports parser-specific priorities. The idea is that the parser with the highest priority gets to be the default SAX parser. The bundled parser, XML::SAX::PurePerl, is not recommended for serious use, so its priority is set to 10. The default priority, when the '--priority' option is not used, is 50. Parsers with the same priority are ordered alphabetically by their module name, and the last one is the winner. If you want to change the priority of your module later, just remove the module with the old priority and the re-add it with the new priority. Below is an example of a postinst script: #!/bin/sh ## ---------------------------------------------------------------------- ## debian/postinst : postinstallation script for libxml-foo-perl ## ---------------------------------------------------------------------- ## ---------------------------------------------------------------------- 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 ## ---------------------------------------------------------------------- and of a prerm script: #!/bin/sh ## ---------------------------------------------------------------------- ## debian/prerm : preremoval script for libxml-foo-perl ## ---------------------------------------------------------------------- ## ---------------------------------------------------------------------- set -e ## ---------------------------------------------------------------------- if [ "$1" = remove ] then update-perl-sax-parsers --remove XML::FOO --priority 60 update-perl-sax-parsers --update fi ## ---------------------------------------------------------------------- ## automatically generated debhelper commands #DEBHELPER# exit 0 ## ---------------------------------------------------------------------- For the above to work properly the package needs to have a versioned dependency on 'libxml-sax-perl (>= 0.16+dfsg-1)'. You can find these examples in the directory '/usr/share/doc/libxml-sax-perl/examples'. Local Parser SAX parser module registration ------------------------------------------- The `update-perl-sax-parsers` script can also be used to maintain local Perl SAX parser module registration. When (de)registering a Perl SAX parser module to the registry one can indicate a directory (default is '/var/lib/libxml-sax-perl/ParserDetails.d'), e.g.: update-perl-sax-parsers --add XML::FOO \ --directory /usr/local/share/perl5/XML/SAX/ParserDetails.d update-perl-sax-parsers --remove XML::FOO \ --directory /usr/local/share/perl5/XML/SAX/ParserDetails.d Note that the indicated directory has to exist before invoking the script. When generating the 'ParserDetails.ini' file one can indicate its directory (default is '/etc/perl/XML/SAX/ParserDetails.ini') as well as one or more 'ParserDetails.d' directories to be used as sources. An example: update-perl-sax-parsers --update \ --file /usr/local/share/perl5/XML/SAX/ParserDetails.ini \ --directory /usr/local/share/perl5/XML/SAX/ParserDetails.d \ --directory /var/lib/libxml-sax-perl/ParserDetails.d Original CPAN Package vs. Debian Package ---------------------------------------- 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. If it's too late and you already have another version of XML::SAX in /usr/local shadowing the Debian one, this entry from an old version of the CPAN FAQ (that has apparently been removed since) may be helpful: How do I remove installed Perl modules? By using the ExtUtils::Installed and ExtUtils::Packlist modules that come with Perl as in the example below. There is also a more elaborate example in the ExtUtils::Packlist man page. #!/usr/local/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print "removing $item\n"; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile; This text was originally written by Ardo van Rangelrooij . -- Niko Tyni Fri, 04 Apr 2008 15:57:01 +0300 debian/libxml-sax-perl.install0000664000000000000000000000004711762206614013606 0ustar debian/update-perl-sax-parsers usr/bin debian/update-perl-sax-parsers.80000664000000000000000000001231711762206614013762 0ustar .\" -*- 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 Niko Tyni .\" .\" ---------------------------------------------------------------------- .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. .\" .\" ---------------------------------------------------------------------- debian/repack.local0000664000000000000000000000004411762206614011454 0ustar MANIFEST=1 rm testfiles/xmltest.xml debian/preinst0000664000000000000000000000240411762206614010604 0ustar #!/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 ## ---------------------------------------------------------------------- debian/postrm0000664000000000000000000000174111762206614010447 0ustar #!/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 which ucf >/dev/null 2>&1 then ucf --purge /etc/perl/XML/SAX/ParserDetails.ini fi if which 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 ## ---------------------------------------------------------------------- debian/libxml-sax-perl.examples0000664000000000000000000000002211762206614013747 0ustar debian/examples/* debian/prerm0000664000000000000000000000130611762206614010245 0ustar #!/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 ## ---------------------------------------------------------------------- debian/control0000664000000000000000000000361312011262730010570 0ustar Source: libxml-sax-perl Section: perl Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Perl Group Uploaders: Jay Bonci , Niko Tyni , Antonio Radici , Ansgar Burchardt , Florian Schlichting Standards-Version: 3.9.3 Homepage: http://search.cpan.org/dist/XML-SAX/ Vcs-Git: git://git.debian.org/pkg-perl/packages/libxml-sax-perl.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libxml-sax-perl.git Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl, libxml-namespacesupport-perl, libxml-sax-base-perl Package: libxml-sax-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libxml-namespacesupport-perl, libxml-sax-base-perl, ucf (>= 0.28) Recommends: 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. debian/update-perl-sax-parsers0000664000000000000000000001404111762206614013610 0ustar #!/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 ( ) { 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 < --add $name --remove $name --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"; } ## ---------------------------------------------------------------------- debian/changelog0000664000000000000000000002574612011262722011053 0ustar libxml-sax-perl (0.99+dfsg-2ubuntu1) quantal; urgency=low * SAX.pm: provide our own local dirname() function and use it instead of File::Basename. Copied from doc-base. (LP: #990256) -- Stéphane Graber Fri, 10 Aug 2012 15:49:30 -0400 libxml-sax-perl (0.99+dfsg-2) unstable; urgency=low * Fix a command injection bug in update-perl-sax-parsers (LP: #782479). * Bump Standards-Version to 3.9.3 (use copyright-format 1.0). * Bump years of Debian copyright. -- Florian Schlichting Fri, 01 Jun 2012 19:08:31 +0200 libxml-sax-perl (0.99+dfsg-1) unstable; urgency=low [ Florian Schlichting ] * Imported Upstream version 0.99 * Update d/watch. * Switch to source format "3.0 (quilt)". * Bump compatibility level to 8. * Refresh d/copyright. * Bump Standards-Version to 3.9.2 (no further changes). * (Build-)Depend on libxml-sax-base-perl. * Add myself to Uploaders. * Remove copyright statement for removed XML::SAX::Base. [ Ansgar Burchardt ] * Update my email address. * debian/control: Convert Vcs-* fields to Git. -- Florian Schlichting Wed, 14 Sep 2011 14:49:55 +0000 libxml-sax-perl (0.96+dfsg-2) unstable; urgency=low [ Ansgar Burchardt ] * Move Debian-specific functions to a subclass as suggested by Evan Carroll. If XML::SAX is installed via CPAN, it will not see the ParserDetails.ini in /etc/perl/XML/SAX, ie. users will have to enable additional parsers by hand or install them via CPAN as well. (LP: #13917) * Use minimal debian/rules. * Add myself to Uploaders. * Bump Standards-Version to 3.8.3 (no changes). [ gregor herrmann ] * Adjust debian/{rules,copyright} to debian/repack.stub. * debian/patches: update formatting and headers. * New patch pod-spelling: fix some spelling errors in the POD. -- Ansgar Burchardt Sat, 02 Jan 2010 19:28:28 +0900 libxml-sax-perl (0.96+dfsg-1) unstable; urgency=low [ Antonio Radici ] * New upstream release * debian/control: + Adding me to the uploaders + Standards-Version bumped to 3.8.0 + dh compatibility >= 7 + removed duplicate priority and section from the binary package + removed (>= 0.40) from quilt * debian/libxml-sax-perl.([^(:?dirs)]) renamed to $1 * debian/rules + custom directives moved to proper files before refreshing to dh7 * debian/libpam-xml-perl.{links,install,examples,manpages} * debian/clean + get-orig-source from the old rules + touch Makefile in clean target from the old rules * debian/compat bumped to 7 * debian/README.Debian-source contents moved to debian/copyright * debian/copyright: + upgrade to the new format + added info about repack.pl and what we are excluding from the orig source [ Franck Joncourt ] * Replace uversionmangle by dversionmangle in debian/watch. + Refreshed the repack.pl script. + This fixes the following lintian warning: http://lintian.debian.org/tags/debian-watch-file-should-dversionmangle\ -not-uversionmangle.html [ gregor herrmann ] * Add debian/README.source to document quilt usage, as required by Debian Policy since 3.8.0. * debian/control: - switch Vcs-Browser field to ViewSVN - add ${misc:Depends} to Depends: field - mention module name in long description -- Antonio Radici Sun, 01 Mar 2009 01:17:39 +0000 libxml-sax-perl (0.16+dfsg-3) unstable; urgency=low * README.Debian: replace a broken link to the CPAN FAQ entry about uninstalling CPAN modules with its intended content. (Closes: #469958) -- Niko Tyni Fri, 04 Apr 2008 16:00:12 +0300 libxml-sax-perl (0.16+dfsg-2) unstable; urgency=low * Remove the XS-DM-Upload-Allowed control field: I'm a DD now. * Switch to my @debian.org email address. * Upgrade to Standards-Version 3.7.3. No changes needed. * Don't set INSTALLVENDORARCH and the like; remove the empty /usr/lib/perl5 directory only if it exists. * Handle stamp files with 'touch $@'. * Don't ship the /etc/perl/XML/SAX directory in the file list, handle it with the maintainer scripts instead. * Remove the unnecessary -1 Debian revision from the quilt build-dependency to ease backporting. Thanks, lintian. * update-perl-sax-parsers: Mention the parser priority when adding or removing it. * Make the maintainer scripts more verbose. * Upload to unstable. -- Niko Tyni Tue, 12 Feb 2008 20:17:01 +0200 libxml-sax-perl (0.16+dfsg-1) experimental; urgency=low [ Niko Tyni ] * New maintainer: Debian Perl Group + leave Jay Bonci in the Uploaders field. * Acknowledge NMUs. (Closes: #441473) * Add support for SAX parser priorities. + lower the XML::SAX::PurePerl priority so that it will not be the default parser anymore if any others are available. (Closes: #430118) * Move the /etc/perl/XML/SAX/ParserDetails.d directory under /var/lib/libxml-sax-perl, since it's not really configuration data. * Use ucf to manage local changes to /etc/perl/XML/SAX/ParserDetails.ini. * Remove the pre-sarge preinst cleanup of /etc/XML and /etc/perl/SAX introduced in 0.12-3. + Now survives systems with a leftover symlink /etc/perl/XML -> . (Closes: #240356) * Point to the compressed file in XML::SAX::save_parsers(). (Closes: #332440) * Recommend libxml-sax-expat-perl and explain this in the package description. (Closes: #420687) * Upgrade to debhelper compatibility level 5. * Upgrade to Standards-Version 3.7.2. No changes needed. * Don't install the upstream README file, there's no information in it. * Update debian/copyright. * Add explanations in the examples to clarify why they look like stray maintainer scripts. (Closes: #295398) * Various improvements in debian/rules. + remove generated files in the 'clean' target. * Update debian/watch. * Move the examples under debian/, they are Debian-specific. * Use quilt to manage debian/patches. + charset-decoding: Fix charset decoding in the PurePerl module (#405186) + parserdetails-debian: The Debian way of handling ParserDetails.ini + skip-test-with-nonfree-file: skip tests in t/16large.t depending on a non-free input file. * Move update-perl-sax-parsers under debian/ in the source package, it's Debian-specific. * Remove an unused Debian modification: XML::SAX->load_parsers() doesn't accept the '$file' argument anymore. * README.Debian: add a pointer to the CPAN FAQ entry on uninstalling local modules. Thanks to Streph Treadway . (Closes: #229178) * Make update-perl-sax-parsers bail out with an informative error message if there's a locally installed XML::SAX module breaking the installation. (See #229178) * Repackage the upstream tarball to remove the non-free testfiles/xmltest.xml file. (Closes: #452872) * Add the Homepage, Vcs-Svn and Vcs-Browser fields to debian/control. * Upload to experimental for now because of the scope of the changes. Test reports welcome, including 'it works for me'. [ Damyan Ivanov ] * Move $(QUILT_STAMPFN) dependency from build to build-stamp * Add XS-DM-Upload-Allowed: yes to debian/control so Niko Tyni can exercise his DM powers :) -- Niko Tyni Tue, 27 Nov 2007 21:13:59 +0200 libxml-sax-perl (0.16-0.1) unstable; urgency=low * Non-maintainer upload. * New upstream release 0.16: - Fixes PI parsing bug; closes: #419757. * Apply patch from CPAN RT#26588; closes: #405186. -- Robert S. Edmonds Sun, 09 Sep 2007 22:20:15 -0400 libxml-sax-perl (0.14-0.1) unstable; urgency=low * Non-Maintainer Upload by Gunnar Wolf, pkg-perl team * Moved debhelper from build-depends-indep to build-depends * New upstream release -- Gunnar Wolf Fri, 15 Dec 2006 12:50:56 -0600 libxml-sax-perl (0.12-5) unstable; urgency=low * Adds debian/watch file so uscan will work -- Jay Bonci Wed, 27 Oct 2004 13:02:32 -0400 libxml-sax-perl (0.12-4) unstable; urgency=low * New Maintainer (Closes: #210543) * Updated policy-version to 3.6.1.0 (No other changes) -- Jay Bonci Mon, 15 Mar 2004 14:47:44 -0500 libxml-sax-perl (0.12-3) unstable; urgency=low * debian/libxml-sax-perl.preinst: changed to properly clean-up mess created by earlier versions with /etc/XML and /etc/perl/SAX (closes: Bug#187520) * Added note about conflixt with the original CPAN package (closes: Bug#188410) * debian/control: updated sections according to latest archive changes: - 'libxml-sax-perl' from 'interpreters' to 'perl' * debian/control: upgraded build dependency on 'debhelper' to '>= 4.1' * debian/control: upgraded to Debian Policy 3.6.0 (no changes) -- Ardo van Rangelrooij Wed, 3 Sep 2003 15:17:00 -0500 libxml-sax-perl (0.12-2) unstable; urgency=low * debian/preinst: fixed to handle not-yet-existing '/etc/perl' directory (closes: Bug#179981, Bug#185146) * debian/rules: moved debhelper compatibility level setting to 'debian/compat' per latest debhelper best practices -- Ardo van Rangelrooij Sun, 23 Mar 2003 11:33:39 -0600 libxml-sax-perl (0.12-1) unstable; urgency=low * New upstream release * debian/copyright: updated * debian/control: upgraded to Debian Policy 3.5.8 (no changes) * debian/libxml-sax-perl.postrm: fixed to not to try to remove '/etc' (closes: Bug#175485) * Moved '/etc/XML' to '/etc/perl/XML' * update-perl-sax-parsers: updated copyright * update-perl-sax-parsers: ported to Getopt::Long; * update-perl-sax-parsers: added '--file' and '--directory' options to support local Perl SAX parser module registration (see manual page and README.Debian for all the details) (closes: Bug#130376) * update-perl-sax-parsers.8: updated to reflect changes * README.Debian: updated to reflect changes and added more info * Added examples for postinst and prerm scripts -- Ardo van Rangelrooij Sun, 2 Feb 2003 11:56:49 -0600 libxml-sax-perl (0.10-3) unstable; urgency=low * debian/rules: added erroneously removed 'dh_testroot' to 'binary-indep' -- Ardo van Rangelrooij Sun, 4 Aug 2002 14:37:01 -0500 libxml-sax-perl (0.10-2) unstable; urgency=low * debian/rules: upgraded to debhelper v4 * debian/control: changed build dependency on debhelper accordingly * debian/rules: migrated from 'dh_movefiles' to 'dh_install' * debian/rules: split off 'install' target from 'binary-indep' target * debian/copyright: added pointer to license -- Ardo van Rangelrooij Sat, 3 Aug 2002 17:04:08 -0500 libxml-sax-perl (0.10-1) unstable; urgency=low * New upstream release * debian/control: added (build) dependency on 'libxml-namespacesupport-perl' -- Ardo van Rangelrooij Thu, 21 Feb 2002 23:24:07 -0600 libxml-sax-perl (0.03-1) unstable; urgency=low * Initial release (closes: Bug#119980) -- Ardo van Rangelrooij Tue, 1 Jan 2002 09:38:12 -0600 debian/libxml-sax-perl.manpages0000664000000000000000000000004111762206614013725 0ustar debian/update-perl-sax-parsers.8