[libxml-xpath-perl] 03/04: Refresh 2 patches.
gregor herrmann
gregoa at debian.org
Mon Feb 22 21:23:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libxml-xpath-perl.
commit 7c914060b51bde3b75413fa166f4bf01265daad9
Author: gregor herrmann <gregoa at debian.org>
Date: Mon Feb 22 22:15:22 2016 +0100
Refresh 2 patches.
---
debian/patches/example.patch | 215 +++++++++++----------
...ption-to-work-without-internet-connection.patch | 34 ++--
2 files changed, 126 insertions(+), 123 deletions(-)
diff --git a/debian/patches/example.patch b/debian/patches/example.patch
index 3ecd77e..fe8c8af 100644
--- a/debian/patches/example.patch
+++ b/debian/patches/example.patch
@@ -9,80 +9,83 @@ Description:
--- a/examples/xpath
+++ b/examples/xpath
-@@ -1,74 +1,115 @@
- #!/usr/bin/perl -w
-+
+@@ -1,79 +1,116 @@
+ #!/usr/bin/perl
+
+eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
+ if 0; # not running under some shell
use strict;
+ use warnings;
$| = 1;
-unless (@ARGV >= 1) {
-- print STDERR qq(Usage:
+- print STDERR qq(Usage:
-$0 [filename] query
--
+-
- If no filename is given, supply XML on STDIN.
-);
-- exit;
+- exit;
-}
-
+ use utf8;
use XML::XPath;
+ use open ':std', ':encoding(UTF-8)';
-my $xpath;
--
+my @paths;
my $pipeline;
-+my $SUFFIX = "\n";
-+my $PREFIX = "";
-+my $quiet = 0;
-
+-
-if ($ARGV[0] eq '-p') {
-- # pipeline mode
-- $pipeline = 1;
-- shift @ARGV;
+- # pipeline mode
+- $pipeline = 1;
+- shift @ARGV;
-}
+-
-if (@ARGV >= 2) {
-- $xpath = XML::XPath->new(filename => shift(@ARGV));
+- $xpath = XML::XPath->new(filename => shift(@ARGV));
-}
-else {
-- $xpath = XML::XPath->new(ioref => \*STDIN);
+- $xpath = XML::XPath->new(ioref => \*STDIN);
++my $SUFFIX = "\n";
++my $PREFIX = "";
++my $quiet = 0;
+
+PARSE: while ((@ARGV >= 1) && ($ARGV[0] =~ /^-./ )) {
-+ OPTIONS: {
-+ if ($ARGV[0] eq "-e") {
-+ shift;
-+ push @paths, shift;
-+ last OPTIONS;
-+ }
-+ if ($ARGV[0] eq "-p") {
-+ shift;
-+ $PREFIX = shift;
-+ last OPTIONS;
-+ }
-+ if ($ARGV[0] eq "-s") {
-+ shift;
-+ $SUFFIX = shift;
-+ last OPTIONS;
-+ }
-+ if ($ARGV[0] eq "-q") {
-+ $quiet = 1;
-+ shift;
-+ last OPTIONS;
-+ }
-+ print STDERR "Unknown option ignore: ", shift;
-+ }
++ OPTIONS: {
++ if ($ARGV[0] eq "-e") {
++ shift;
++ push @paths, shift;
++ last OPTIONS;
++ }
++ if ($ARGV[0] eq "-p") {
++ shift;
++ $PREFIX = shift;
++ last OPTIONS;
++ }
++ if ($ARGV[0] eq "-s") {
++ shift;
++ $SUFFIX = shift;
++ last OPTIONS;
++ }
++ if ($ARGV[0] eq "-q") {
++ $quiet = 1;
++ shift;
++ last OPTIONS;
++ }
++ print STDERR "Unknown option ignore: ", shift;
++ }
}
-my $nodes = $xpath->find(shift @ARGV);
+unless (@paths >= 1) {
-+ print STDERR qq(Usage:
++ print STDERR qq(Usage:
+$0 [options] -e query [-e query...] [filename...]
-unless ($nodes->isa('XML::XPath::NodeSet')) {
-NOTNODES:
-- print STDERR "Query didn't return a nodeset. Value: ";
-- print $nodes->value, "\n";
+- print STDERR "Query didn't return a nodeset. Value: ";
+- print $nodes->value, "\n";
+ If no filenams are given, supply XML on STDIN.
+ You must provide at least one query. Each supplementary
+ query is done in order, the previous query giving the
@@ -94,88 +97,88 @@ Description:
+ -s suffix use suffix instead of linefeed.
+ -p postfix use prefix instead of nothing.
+);
- exit;
+ exit;
}
-if ($pipeline) {
-- $nodes = find_more($nodes);
-- goto NOTNODES unless $nodes->isa('XML::XPath::NodeSet');
+- $nodes = find_more($nodes);
+- goto NOTNODES unless $nodes->isa('XML::XPath::NodeSet');
-}
+do
+{
-+ my $xpath;
-+ my @curpaths = @paths;
-+ my $filename;
-+ if (@ARGV >= 1) {
-+ $filename = shift @ARGV;
-+ $xpath = XML::XPath->new(filename => $filename);
-+ }
-+ else {
-+ $filename = 'stdin';
-+ $xpath = XML::XPath->new(ioref => \*STDIN);
-+ }
++ my $xpath;
++ my @curpaths = @paths;
++ my $filename;
++ if (@ARGV >= 1) {
++ $filename = shift @ARGV;
++ $xpath = XML::XPath->new(filename => $filename);
++ }
++ else {
++ $filename = 'stdin';
++ $xpath = XML::XPath->new(ioref => \*STDIN);
++ }
-if ($nodes->size) {
-- print STDERR "Found ", $nodes->size, " nodes:\n";
-- foreach my $node ($nodes->get_nodelist) {
-- print STDERR "-- NODE --\n";
-- print $node->toString;
-+ my $nodes = $xpath->find(shift @curpaths);
-+
-+ if ($nodes->isa('XML::XPath::NodeSet')) {
-+ while (@curpaths >= 1) {
-+ $nodes = find_more($xpath, shift @curpaths, $nodes);
-+ last unless $nodes->isa('XML::XPath::NodeSet');
-+ }
-+ }
-+
-+ if ($nodes->isa('XML::XPath::NodeSet')) {
-+ if ($nodes->size) {
-+ print STDERR "Found ", $nodes->size, " nodes in $filename:\n" unless $quiet;
-+ foreach my $node ($nodes->get_nodelist) {
-+ print STDERR "-- NODE --\n" unless $quiet;
-+ print $PREFIX, $node->toString, $SUFFIX;
-+ }
-+ }
-+ else {
-+ print STDERR "No nodes found in $filename\n" unless $quiet;
-+ }
-+ }
-+ else {
-+ print STDERR "Query didn't return a nodeset. Value: ";
-+ print $nodes->value, "\n";
- }
+- print STDERR "Found ", $nodes->size, " nodes:\n";
+- foreach my $node ($nodes->get_nodelist) {
+- print STDERR "-- NODE --\n";
+- print $node->toString;
++ my $nodes = $xpath->find(shift @curpaths);
++
++ if ($nodes->isa('XML::XPath::NodeSet')) {
++ while (@curpaths >= 1) {
++ $nodes = find_more($xpath, shift @curpaths, $nodes);
++ last unless $nodes->isa('XML::XPath::NodeSet');
++ }
+ }
-}
-else {
-- print STDERR "No nodes found";
+- print STDERR "No nodes found";
-}
-print STDERR "\n";
++ if ($nodes->isa('XML::XPath::NodeSet')) {
++ if ($nodes->size) {
++ print STDERR "Found ", $nodes->size, " nodes in $filename:\n" unless $quiet;
++ foreach my $node ($nodes->get_nodelist) {
++ print STDERR "-- NODE --\n" unless $quiet;
++ print $PREFIX, $node->toString, $SUFFIX;
++ }
++ }
++ else {
++ print STDERR "No nodes found in $filename\n" unless $quiet;
++ }
++ }
++ else {
++ print STDERR "Query didn't return a nodeset. Value: ";
++ print $nodes->value, "\n";
++ }
+} until (@ARGV < 1);
exit;
sub find_more {
-+ my $xpath = shift;
-+ my $find = shift;
- my ($nodes) = @_;
-- if (!@ARGV) {
-- return $nodes;
-- }
-
- my $newnodes = XML::XPath::NodeSet->new;
-
-- my $find = shift @ARGV;
--
- foreach my $node ($nodes->get_nodelist) {
- my $new = $xpath->find($find, $node);
- if ($new->isa('XML::XPath::NodeSet')) {
-@@ -79,5 +120,83 @@ sub find_more {
- }
- }
-
-- return find_more($newnodes);
-+ return $newnodes;
++ my $xpath = shift;
++ my $find = shift;
+ my ($nodes) = @_;
+
+- if (!@ARGV) {
+- return $nodes;
+- }
+-
+ my $newnodes = XML::XPath::NodeSet->new;
+
+- my $find = shift @ARGV;
+-
+ foreach my $node ($nodes->get_nodelist) {
+ my $new = $xpath->find($find, $node);
+ if ($new->isa('XML::XPath::NodeSet')) {
+@@ -84,5 +121,83 @@
+ }
+ }
+
+- return find_more($newnodes);
++ return $newnodes;
}
+
+__END__
diff --git a/debian/patches/xpath-option-to-work-without-internet-connection.patch b/debian/patches/xpath-option-to-work-without-internet-connection.patch
index 677476e..7fd151e 100644
--- a/debian/patches/xpath-option-to-work-without-internet-connection.patch
+++ b/debian/patches/xpath-option-to-work-without-internet-connection.patch
@@ -5,27 +5,27 @@ Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?filename=xpath-external.pa
--- a/examples/xpath
+++ b/examples/xpath
-@@ -37,6 +37,11 @@
- shift;
- last OPTIONS;
- }
-+ if ($ARGV[0] eq "-n") {
-+ $XML::XPath::ParseParamEnt = 0;
-+ shift;
-+ last OPTIONS;
-+ }
- print STDERR "Unknown option ignore: ", shift;
- }
+@@ -39,6 +39,11 @@
+ shift;
+ last OPTIONS;
+ }
++ if ($ARGV[0] eq "-n") {
++ $XML::XPath::ParseParamEnt = 0;
++ shift;
++ last OPTIONS;
++ }
+ print STDERR "Unknown option ignore: ", shift;
+ }
}
-@@ -55,6 +60,7 @@
+@@ -57,6 +62,7 @@
-q quiet. Only output the resulting PATH
-s suffix use suffix instead of linefeed.
-p postfix use prefix instead of nothing.
+ -n Don't use an external DTD.
);
- exit;
+ exit;
}
-@@ -131,7 +137,7 @@
+@@ -132,7 +138,7 @@
=head1 SYNOPSIS
@@ -34,11 +34,11 @@ Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?filename=xpath-external.pa
=head1 DESCRIPTION
-@@ -154,6 +160,11 @@
+@@ -155,6 +161,11 @@
Be quiet. Output only errors (and no separator) on stderr.
-+=head2 B<-e>
++=head2 B<-n>
+
+Never use an external DTD, ie. instantiate the XML::Parser module
+with 'ParseParamEnt => 0'.
@@ -50,7 +50,7 @@ Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?filename=xpath-external.pa
+++ b/lib/XML/XPath.pm
@@ -15,6 +15,7 @@
- $VERSION = '1.30';
+ $VERSION = '1.31';
$XML::XPath::Namespaces = 1;
+$XML::XPath::ParseParamEnt = 1;
$XML::XPath::Debug = 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libxml-xpath-perl.git
More information about the Pkg-perl-cvs-commits
mailing list