2023-08-09 13:53:27 +00:00
committed by Git OBS Bridge
parent 03fccf42d8
commit 312527d39e
4 changed files with 44 additions and 14 deletions

View File

@@ -4,8 +4,8 @@
#sources: #sources:
# - source1 # - source1
# - source2 # - source2
#patches: patches:
# foo.patch: -p1 fix-05_empty.patch: -p1 PATCH-FIX-UPSTREAM fix 05_empty.t https://github.com/tokuhirom/HTML-TreeBuilder-LibXML/pull/17
# bar.patch: # bar.patch:
#preamble: |- #preamble: |-
# BuildRequires: gcc-c++ # BuildRequires: gcc-c++

24
fix-05_empty.patch Normal file
View File

@@ -0,0 +1,24 @@
From d74d1f186b2e2c6334a78b895b0ea811a16617a4 Mon Sep 17 00:00:00 2001
From: Emmanuel Seyman <emmanuel@seyman.fr>
Date: Mon, 14 Jun 2021 21:12:07 +0200
Subject: [PATCH] fallback to toString() when toStringC14N(1) gives an empty
string
---
lib/HTML/TreeBuilder/LibXML/Node.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/HTML/TreeBuilder/LibXML/Node.pm b/lib/HTML/TreeBuilder/LibXML/Node.pm
index f3b4e81..b710dda 100644
--- a/lib/HTML/TreeBuilder/LibXML/Node.pm
+++ b/lib/HTML/TreeBuilder/LibXML/Node.pm
@@ -74,7 +74,8 @@ sub as_HTML {
{
local $@; # protect existing $@
my $output = eval { $_[0]->{node}->toStringC14N(1) };
- return $@ ? $_[0]->{node}->toString : $output;
+ return $_[0]->{node}->toString if ($@ or $output eq '');
+ return $output;
}
}

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 9 12:49:16 UTC 2023 - Tina Müller <tina.mueller@suse.com>
- Add fix-05_empty.patch, see
https://github.com/tokuhirom/HTML-TreeBuilder-LibXML/pull/17
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 21 05:33:57 UTC 2016 - coolo@suse.com Fri Oct 21 05:33:57 UTC 2016 - coolo@suse.com

View File

@@ -1,7 +1,7 @@
# #
# spec file for package perl-HTML-TreeBuilder-LibXML # spec file for package perl-HTML-TreeBuilder-LibXML
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -12,22 +12,22 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
%define cpan_name HTML-TreeBuilder-LibXML
Name: perl-HTML-TreeBuilder-LibXML Name: perl-HTML-TreeBuilder-LibXML
Version: 0.26 Version: 0.26
Release: 0 Release: 0
%define cpan_name HTML-TreeBuilder-LibXML License: Artistic-1.0 OR GPL-1.0-or-later
Summary: HTML::TreeBuilder and XPath compatible interface with libxml Summary: HTML::TreeBuilder and XPath compatible interface with libxml
License: Artistic-1.0 or GPL-1.0+ URL: https://metacpan.org/release/%{cpan_name}
Group: Development/Libraries/Perl Source0: https://cpan.metacpan.org/authors/id/T/TO/TOKUHIROM/%{cpan_name}-%{version}.tar.gz
Url: http://search.cpan.org/dist/HTML-TreeBuilder-LibXML/
Source0: http://www.cpan.org/authors/id/T/TO/TOKUHIROM/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml Source1: cpanspec.yml
# PATCH-FIX-UPSTREAM fix 05_empty.t https://github.com/tokuhirom/HTML-TreeBuilder-LibXML/pull/17
Patch0: fix-05_empty.patch
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl BuildRequires: perl
BuildRequires: perl-macros BuildRequires: perl-macros
BuildRequires: perl(HTML::TreeBuilder::XPath) >= 0.14 BuildRequires: perl(HTML::TreeBuilder::XPath) >= 0.14
@@ -54,10 +54,10 @@ This module doesn't implement all of HTML::TreeBuilder and HTML::Element
APIs, but enough methods are defined so modules like Web::Scraper work. APIs, but enough methods are defined so modules like Web::Scraper work.
%prep %prep
%setup -q -n %{cpan_name}-%{version} %autosetup -n %{cpan_name}-%{version} -p1
%build %build
%{__perl} Build.PL --installdirs=vendor perl Build.PL --installdirs=vendor
./Build build --flags=%{?_smp_mflags} ./Build build --flags=%{?_smp_mflags}
%check %check
@@ -68,7 +68,7 @@ APIs, but enough methods are defined so modules like Web::Scraper work.
%perl_gen_filelist %perl_gen_filelist
%files -f %{name}.files %files -f %{name}.files
%defattr(-,root,root,755) %doc Changes README.md
%doc Changes LICENSE README.md %license LICENSE
%changelog %changelog