Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-HTML-Form for openSUSE:Factory checked in at 2022-08-25 15:33:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-HTML-Form (Old) and /work/SRC/openSUSE:Factory/.perl-HTML-Form.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-HTML-Form" Thu Aug 25 15:33:05 2022 rev:15 rq:998973 version:6.10 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-HTML-Form/perl-HTML-Form.changes 2022-08-17 18:22:10.055056227 +0200 +++ /work/SRC/openSUSE:Factory/.perl-HTML-Form.new.2083/perl-HTML-Form.changes 2022-08-25 15:33:07.367927862 +0200 @@ -1,0 +2,15 @@ +Tue Aug 23 03:06:37 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 6.10 + see /usr/share/doc/packages/perl-HTML-Form/Changes + + 6.10 2022-08-22 13:20:12Z + - Use "croak" instead of "die" to show errors from the perspective of the + caller [RT#20499] (GH#29) (Julien Fiegehenn) + - Remove the executable bit from a couple of tests (GH#41) (James Raspass) + - <option>s within select fields without a name no longer get merged into + the previous select field (GH#2) (Julien Fiegehenn) + - find_input() can now take a reference to undef to explicitly find inputs + that have no name (GH#2) (Julien Fiegehenn) + +------------------------------------------------------------------- Old: ---- HTML-Form-6.09.tar.gz New: ---- HTML-Form-6.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-HTML-Form.spec ++++++ --- /var/tmp/diff_new_pack.AxmZEi/_old 2022-08-25 15:33:07.771928744 +0200 +++ /var/tmp/diff_new_pack.AxmZEi/_new 2022-08-25 15:33:07.779928762 +0200 @@ -18,7 +18,7 @@ %define cpan_name HTML-Form Name: perl-HTML-Form -Version: 6.09 +Version: 6.10 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Class that represents an HTML form element @@ -50,7 +50,6 @@ %prep %autosetup -n %{cpan_name}-%{version} -find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build perl Makefile.PL INSTALLDIRS=vendor ++++++ HTML-Form-6.09.tar.gz -> HTML-Form-6.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/Changes new/HTML-Form-6.10/Changes --- old/HTML-Form-6.09/Changes 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/Changes 2022-08-22 15:20:15.000000000 +0200 @@ -1,5 +1,14 @@ Change history for HTML-Form +6.10 2022-08-22 13:20:12Z + - Use "croak" instead of "die" to show errors from the perspective of the + caller [RT#20499] (GH#29) (Julien Fiegehenn) + - Remove the executable bit from a couple of tests (GH#41) (James Raspass) + - <option>s within select fields without a name no longer get merged into + the previous select field (GH#2) (Julien Fiegehenn) + - find_input() can now take a reference to undef to explicitly find inputs + that have no name (GH#2) (Julien Fiegehenn) + 6.09 2022-08-14 22:16:37Z - Replace "use vars" with "our" (GH#34) (James Raspass) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/META.json new/HTML-Form-6.10/META.json --- old/HTML-Form-6.09/META.json 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/META.json 2022-08-22 15:20:15.000000000 +0200 @@ -80,39 +80,39 @@ "provides" : { "HTML::Form" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::FileInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::IgnoreInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::ImageInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::Input" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::KeygenInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::ListInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::SubmitInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" }, "HTML::Form::TextInput" : { "file" : "lib/HTML/Form.pm", - "version" : "6.09" + "version" : "6.10" } }, "release_status" : "stable", @@ -129,7 +129,7 @@ "x_IRC" : "irc://irc.perl.org/#lwp", "x_MailingList" : "mailto:lib...@perl.org" }, - "version" : "6.09", + "version" : "6.10", "x_Dist_Zilla" : { "perl" : { "version" : "5.028000" @@ -339,7 +339,7 @@ } }, "name" : "Test::Portability", - "version" : "2.001000" + "version" : "2.001001" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", @@ -668,7 +668,7 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "v6.09", + "tag" : "v6.10", "tag_format" : "v%V", "tag_message" : "v%V" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/META.yml new/HTML-Form-6.10/META.yml --- old/HTML-Form-6.09/META.yml 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/META.yml 2022-08-22 15:20:15.000000000 +0200 @@ -24,31 +24,31 @@ provides: HTML::Form: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::FileInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::IgnoreInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::ImageInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::Input: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::KeygenInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::ListInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::SubmitInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' HTML::Form::TextInput: file: lib/HTML/Form.pm - version: '6.09' + version: '6.10' requires: Carp: '0' Encode: '2' @@ -65,7 +65,7 @@ bugtracker: https://github.com/libwww-perl/HTML-Form/issues homepage: https://github.com/libwww-perl/HTML-Form repository: https://github.com/libwww-perl/HTML-Form.git -version: '6.09' +version: '6.10' x_Dist_Zilla: perl: version: '5.028000' @@ -228,7 +228,7 @@ Dist::Zilla::Plugin::Test::Portability: options: '' name: Test::Portability - version: '2.001000' + version: '2.001001' - class: Dist::Zilla::Plugin::Test::EOL config: @@ -480,7 +480,7 @@ branch: ~ changelog: Changes signed: 0 - tag: v6.09 + tag: v6.10 tag_format: v%V tag_message: v%V Dist::Zilla::Role::Git::Repo: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/Makefile.PL new/HTML-Form-6.10/Makefile.PL --- old/HTML-Form-6.09/Makefile.PL 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/Makefile.PL 2022-08-22 15:20:15.000000000 +0200 @@ -33,7 +33,7 @@ "Test::More" => "0.96", "warnings" => 0 }, - "VERSION" => "6.09", + "VERSION" => "6.10", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/lib/HTML/Form.pm new/HTML-Form-6.10/lib/HTML/Form.pm --- old/HTML-Form-6.09/lib/HTML/Form.pm 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/lib/HTML/Form.pm 2022-08-22 15:20:15.000000000 +0200 @@ -5,7 +5,7 @@ use Carp (); use Encode (); -our $VERSION = '6.09'; +our $VERSION = '6.10'; my %form_tags = map {$_ => 1} qw(input textarea button select option); @@ -48,7 +48,7 @@ require HTML::TokeParser; my $p = HTML::TokeParser->new(ref($html) ? $html->decoded_content(ref => 1) : \$html); - die "Failed to create HTML::TokeParser object" unless $p; + Carp::croak "Failed to create HTML::TokeParser object" unless $p; my $base_uri = delete $opt{base}; my $charset = delete $opt{charset}; @@ -298,8 +298,8 @@ sub find_input { - my($self, $name, $type, $no) = @_; - die "Invalid index $no" + my($self, $selector, $type, $no) = @_; + Carp::croak "Invalid index $no" if defined $no && $no < 1; if (wantarray) { warn "find_input called in list context with index specified\n" @@ -307,7 +307,20 @@ my @res; my $c; for (@{$self->{'inputs'}}) { - next if defined($name) && !$_->selected($name); + if ( defined($selector) ) { + + # an input that explicitly has no name + if ( ref($selector) eq 'SCALAR' ) { + next + if !defined($$selector) && $_->{name}; + } + + # an input that does not fit this selector + else { + next + if !$_->selected($selector); + } + } next if $type && $type ne $_->{type}; $c++; next if $no && $no != $c; @@ -319,7 +332,20 @@ else { $no ||= 1; for (@{$self->{'inputs'}}) { - next if defined($name) && !$_->selected($name); + if ( defined($selector) ) { + + # an input that explicitly has no name + if ( ref($selector) eq 'SCALAR' ) { + next + if !defined($$selector) && $_->{name}; + } + + # an input that does not fit this selector + else { + next + if !$_->selected($selector); + } + } next if $type && $type ne $_->{type}; next if --$no; return $_; @@ -366,7 +392,7 @@ if (@_) { # set - die "No '$name' parameter exists" unless @inputs; + Carp::croak "No '$name' parameter exists" unless @inputs; my @v = @_; @v = @{$v[0]} if @v == 1 && ref($v[0]); while (@v) { @@ -383,7 +409,7 @@ } $err ||= $@; } - die $err if $err; + Carp::croak $err if $err; } # the rest of the input should be cleared @@ -788,11 +814,13 @@ return $self->SUPER::add_to_form($form); } - die "Assert" if @{$self->{menu}} != 1; + Carp::croak "Assert" if @{$self->{menu}} != 1; my $m = $self->{menu}[0]; $m->{disabled}++ if delete $self->{option_disabled}; - my $prev = $form->find_input($self->{name}, $self->{type}, $self->{idx}); + # if there was no name we have to search for an input that explicitly has + # no name either, because otherwise the name attribute would be ignored + my $prev = $form->find_input($self->{name} || \undef, $self->{type}, $self->{idx}); return $self->SUPER::add_to_form($form) unless $prev; # merge menus @@ -1078,7 +1106,7 @@ =head1 VERSION -version 6.09 +version 6.10 =head1 SYNOPSIS @@ -1267,18 +1295,29 @@ inputs that match the arguments given are returned. In scalar context only the first is returned, or C<undef> if none match. -If $selector is not C<undef>, then the input's name, id, class attribute must -match. A selector prefixed with '#' must match the id attribute of the input. -A selector prefixed with '.' matches the class attribute. A selector prefixed -with '^' or with no prefix matches the name attribute. +If C<$selector> is not C<undef>, then the input's I<name>, I<id> or I<class> +attribute must match. +A selector prefixed with '#' must match the I<id> attribute of the input. +A selector prefixed with '.' matches the I<class> attribute. A selector prefixed +with '^' or with no prefix matches the I<name> attribute. + + my @by_id = $form->find_input( '#some-id' ); + my @by_class = $form->find_input( '.some-class' ); + my @by_name = $form->find_input( '^some-name' ); + my @also_by_name = $form->find_input( 'some-name' ); + +If you want to find an input that has no I<name> at all, pass in a reference +to C<undef>. + + my @nameless_inputs = $form->find_input( \undef ); -If $type is not C<undef>, then the input must have the specified type. +If C<$type> is not C<undef>, then the input must have the specified type. The following type names are used: "text", "password", "hidden", "textarea", "file", "image", "submit", "radio", "checkbox" and "option". -The $index is the sequence number of the input matched where 1 is the -first. If combined with $name and/or $type, then it selects the I<n>th -input with the given name and/or type. +The C<$index> is the sequence number of the input matched where 1 is the +first. If combined with C<$selector> and/or C<$type>, then it selects the +I<n>th input with the given I<name> and/or type. =item $value = $form->value( $selector ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/t/form.t new/HTML-Form-6.10/t/form.t --- old/HTML-Form-6.09/t/form.t 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/t/form.t 2022-08-22 15:20:15.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 129; +use Test::More; use HTML::Form; my @warn; @@ -623,3 +623,52 @@ submit= EOT + +# select with a name followed by select without a name GH#2 +$f = HTML::Form->parse(<<EOT, "http://localhost/"); +<form action="target.html" method="get"> +<select> +<option selected>option in unnamed before</option> +</select> +<select name="foo"> +<option selected>option in named</option> +</select> +<select> +<option selected>option in unnamed after 1</option> +</select> +<select name=""> +<option selected>option in empty string name</option> +</select> +EOT + +TODO: { + local $TODO = 'input with empty name should not be included'; + is( + join( "|", $f->form ), + "foo|option in named", + "options in unnamed selects are ignored" + ); +} + +# explicitly selecting an input that has no name +my @nameless_inputs = $f->find_input( \undef ); +is( scalar @nameless_inputs, + 3, 'find_input with ref to undef finds three forms' ); +ok( + ( !grep { $_->{name} } @nameless_inputs ), + '... and none of them has a name' +); + +ok( + !( scalar $f->find_input( \undef ) )->{name}, + 'find_input with ref to undef in scalar context' +); +TODO: { + local $TODO = 'input with empty name should not be included'; + is($f->click->as_string, <<"EOT"); +GET http://localhost/target.html?foo=option+in+named + +EOT +} + +done_testing; \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/xt/author/portability.t new/HTML-Form-6.10/xt/author/portability.t --- old/HTML-Form-6.09/xt/author/portability.t 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/xt/author/portability.t 2022-08-22 15:20:15.000000000 +0200 @@ -3,8 +3,6 @@ use Test::More; -eval 'use Test::Portability::Files'; -plan skip_all => 'Test::Portability::Files required for testing portability' - if $@; +use Test::Portability::Files; run_tests(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Form-6.09/xt/release/changes_has_content.t new/HTML-Form-6.10/xt/release/changes_has_content.t --- old/HTML-Form-6.09/xt/release/changes_has_content.t 2022-08-15 00:16:40.000000000 +0200 +++ new/HTML-Form-6.10/xt/release/changes_has_content.t 2022-08-22 15:20:15.000000000 +0200 @@ -8,7 +8,7 @@ note 'Checking Changes'; my $changes_file = 'Changes'; -my $newver = '6.09'; +my $newver = '6.10'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8';