diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b3099b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/version-0.9907.tar.gz diff --git a/.perl-version.metadata b/.perl-version.metadata new file mode 100644 index 0000000..e36e6dc --- /dev/null +++ b/.perl-version.metadata @@ -0,0 +1 @@ +e34666e7e9e4205fbac24ca8772150c0fd2a4fd5 SOURCES/version-0.9907.tar.gz diff --git a/SOURCES/version-0.9907-Deal-with-certain-tiedscalars-e.g.-created-by-Readon.patch b/SOURCES/version-0.9907-Deal-with-certain-tiedscalars-e.g.-created-by-Readon.patch new file mode 100644 index 0000000..23abd59 --- /dev/null +++ b/SOURCES/version-0.9907-Deal-with-certain-tiedscalars-e.g.-created-by-Readon.patch @@ -0,0 +1,58 @@ +From c286e6d3aa2ecfc311027427c95607ceccb85fae Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 27 Sep 2016 15:56:59 +0200 +Subject: [PATCH 1/2] Deal with certain tiedscalars (e.g. created by + Readonly::XS) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream commit: + +changeset: 480:efb44fbc6bd8 +user: John Peacock +date: Sat Feb 01 13:30:16 2014 -0500 +summary: Deal with certain tiedscalars (e.g. created by Readonly::XS). + +ported from 0.9908 to 0.9907. + +This is necessary to accept tainted input on perl older than 5.17.2. + +Signed-off-by: Petr Písař +--- + vutil/vutil.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/vutil/vutil.c b/vutil/vutil.c +index 7979c49..c5edb10 100644 +--- a/vutil/vutil.c ++++ b/vutil/vutil.c +@@ -555,7 +555,11 @@ Perl_upg_version(pTHX_ SV *ver, bool qv) + + PERL_ARGS_ASSERT_UPG_VERSION; + +- if ( SvNOK(ver) && !( SvPOK(ver) && SvCUR(ver) == 3 ) ) ++ if ( ( SvNOK(ver) ++#if PERL_VERSION_LT(5,17,2) ++ || (SvTYPE(ver) == SVt_PVMG && SvNOKp(ver)) ++#endif ++ ) && !( SvPOK(ver) && SvCUR(ver) == 3 ) ) + { + STRLEN len; + +@@ -602,7 +606,11 @@ Perl_upg_version(pTHX_ SV *ver, bool qv) + version = savesvpv(ver); + SAVEFREEPV(version); + } +- else if ( SvPOK(ver) )/* must be a string or something like a string */ ++ else if ( SvPOK(ver) ++#if PERL_VERSION_LT(5,17,2) ++ || (SvTYPE(ver) == SVt_PVMG && SvPOKp(ver)) ++#endif ++ )/* must be a string or something like a string */ + { + STRLEN len; + version = savepvn(SvPV(ver,len), SvCUR(ver)); +-- +2.7.4 + diff --git a/SOURCES/version-0.9907-Stringify-tainted-version-object-on-perl-older-than-.patch b/SOURCES/version-0.9907-Stringify-tainted-version-object-on-perl-older-than-.patch new file mode 100644 index 0000000..4d266ce --- /dev/null +++ b/SOURCES/version-0.9907-Stringify-tainted-version-object-on-perl-older-than-.patch @@ -0,0 +1,45 @@ +From 4ee6d47e40a527e4c233362109985a421d784c2d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 27 Sep 2016 16:03:16 +0200 +Subject: [PATCH 2/2] Stringify tainted version object on perl older than + 5.17.2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since version-0.9908, version->new() accepts tainted input after +4bac9ae47b5ad7845a24e26b0e95609805de688a change (Magic flags +harmonization) in perl 5.17.2. + +But it cannot stringify resultin version object and returns undef +instead. + +This patch adds support for the stringification. + +CPAN RT#118087 + +Signed-off-by: Petr Písař +--- + vutil/vutil.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/vutil/vutil.c b/vutil/vutil.c +index c5edb10..f17fb0a 100644 +--- a/vutil/vutil.c ++++ b/vutil/vutil.c +@@ -916,7 +916,11 @@ Perl_vstringify(pTHX_ SV *vs) + if (svp) { + SV *pv; + pv = *svp; +- if ( SvPOK(pv) ) ++ if ( SvPOK(pv) ++#if PERL_VERSION_LT(5,17,2) ++ || SvPOKp(pv) ++#endif ++ ) + return newSVsv(pv); + else + return &PL_sv_undef; +-- +2.7.4 + diff --git a/SOURCES/version-0.9907-doc_numify_stringify_trailing_zeros.patch b/SOURCES/version-0.9907-doc_numify_stringify_trailing_zeros.patch new file mode 100644 index 0000000..dcdc9cb --- /dev/null +++ b/SOURCES/version-0.9907-doc_numify_stringify_trailing_zeros.patch @@ -0,0 +1,50 @@ +From 505f82135ffca76fb8072500a7378a725a6d9acd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 9 Mar 2018 15:02:24 +0100 +Subject: [PATCH] doc_numify_stringify_trailing_zeros +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This corrects numify() and stringify() documentation to match code bahavior +that exists for ages. + +CPAN RT#64635 +CPAN RT#122858 + +Signed-off-by: Petr Písař +--- + lib/version.pod | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/lib/version.pod b/lib/version.pod +index 40ceee2..86df045 100644 +--- a/lib/version.pod ++++ b/lib/version.pod +@@ -266,11 +266,10 @@ leading-v and at least 3 components. + + =head2 numify() + +-Returns a value representing the object in a pure decimal form without +-trailing zeroes. ++Returns a value representing the object in a pure decimal. + +- version->declare('v1.2')->numify; # 1.002 +- version->parse('1.2')->numify; # 1.2 ++ version->declare('v1.2')->numify; # 1.002000 ++ version->parse('1.2')->numify; # 1.200 + + =head2 stringify() + +@@ -280,7 +279,7 @@ way perl would normally represent it in a string. This method is used whenever + a version object is interpolated into a string. + + version->declare('v1.2')->stringify; # v1.2 +- version->parse('1.200')->stringify; # 1.200 ++ version->parse('1.200')->stringify; # 1.2 + version->parse(1.02_30)->stringify; # 1.023 + + =head1 EXPORTED FUNCTIONS +-- +2.14.3 + diff --git a/SPECS/perl-version.spec b/SPECS/perl-version.spec new file mode 100644 index 0000000..325d190 --- /dev/null +++ b/SPECS/perl-version.spec @@ -0,0 +1,194 @@ +Name: perl-version +Epoch: 3 +Version: 0.99.07 +%global module_version 0.9907 +Release: 6%{?dist} +Summary: Perl extension for Version Objects +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/version/ +Source0: http://www.cpan.org/authors/id/J/JP/JPEACOCK/version-%{module_version}.tar.gz +# Support parsing tainted values, bug #1378885, in upstream 0.9908 +Patch0: version-0.9907-Deal-with-certain-tiedscalars-e.g.-created-by-Readon.patch +# Support stringifying version objects made from a tainted value, bug #1378885, +# CPAN RT#118087 +Patch1: version-0.9907-Stringify-tainted-version-object-on-perl-older-than-.patch +# Fix documentation about numify() and stringify() trailing zeros, bug #1483562, +# CPAN RT#64635, CPAN RT#122858 +Patch2: version-0.9907-doc_numify_stringify_trailing_zeros.patch +BuildRequires: perl +BuildRequires: perl(base) +BuildRequires: perl(Carp) +BuildRequires: perl(Config) +BuildRequires: perl(constant) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(ExtUtils::CBuilder) +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(File::Basename) +BuildRequires: perl(File::Spec) +BuildRequires: perl(File::Temp) >= 0.13 +# IO::Handle is optional +BuildRequires: perl(lib) +BuildRequires: perl(List::Util) +BuildRequires: perl(locale) +BuildRequires: perl(overload) +BuildRequires: perl(parent) +BuildRequires: perl(POSIX) +BuildRequires: perl(strict) +BuildRequires: perl(Test::More) >= 0.45 +BuildRequires: perl(Test::Harness) +BuildRequires: perl(UNIVERSAL) +BuildRequires: perl(vars) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(UNIVERSAL) +Requires: perl(XSLoader) + +%{?perl_default_filter} +# version::vxs is private module (see bug #633775) +%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}perl\\(version::vxs\\) + +%description +Version objects were added to Perl in 5.10. This module implements version +objects for older version of Perl and provides the version object API for +all versions of Perl. All previous releases before 0.74 are deprecated and +should not be used due to incompatible API changes. Version 0.77 introduces +the new 'parse' and 'declare' methods to standardize usage. You are +strongly urged to set 0.77 as a minimum in your code. + +%prep +%setup -q -n version-%{module_version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +export TZ=UTC +perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=%{buildroot} +find %{buildroot} -type f -name .packlist -exec rm -f {} + +find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} + +%{_fixperms} %{buildroot}/* + +%check +make test + +%files +%doc Changes README +%doc %{perl_vendorarch}/version.pod +%dir %{perl_vendorarch}/version/ +%doc %{perl_vendorarch}/version/Internals.pod +%{perl_vendorarch}/auto/version/ +%{perl_vendorarch}/version.pm +%{perl_vendorarch}/version/vpp.pm +%{perl_vendorarch}/version/vxs.pm +%{perl_vendorarch}/version/regex.pm +%{_mandir}/man3/version.3pm* +%{_mandir}/man3/version::Internals.3pm* + +%changelog +* Mon Aug 12 2019 Petr Pisar - 3:0.99.07-6 +- Define time zone to correct a date in version::Internals manual page + (bug #1483562) + +* Mon Aug 12 2019 Petr Pisar - 3:0.99.07-5 +- Rebuild to correct a date in version::Internals manual page (bug #1483562) + +* Fri Mar 09 2018 Petr Pisar - 3:0.99.07-4 +- Fix documentation about numify() and stringify() trailing zeros + (bug #1483562) + +* Tue Sep 27 2016 Petr Pisar - 3:0.99.07-3 +- Support making version objects from tainted strings (bug #1378885) + +* Fri Jan 24 2014 Daniel Mach - 3:0.99.07-2 +- Mass rebuild 2014-01-24 + +* Wed Jan 15 2014 Petr Šabata - 3:0.99.07-1 +- 0.9907 bugfix bump + +* Tue Jan 07 2014 Petr Šabata - 3:0.99.06-1 +- 0.9906 bump + +* Tue Sep 10 2013 Petr Šabata - 3:0.99.04-2 +- Release bump to (hopefully) fix the build + +* Tue Sep 10 2013 Petr Šabata - 3:0.99.04-1 +- 0.9904 bump + +* Mon Aug 26 2013 Petr Šabata - 3:0.99.03-1 +- 0.9903 bump +- Prefer %%global over %%define + +* Sun Aug 04 2013 Fedora Release Engineering - 3:0.99.02-291 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jul 15 2013 Petr Pisar - 3:0.99.02-290 +- Increase release to favour standalone package + +* Fri Jul 12 2013 Petr Pisar - 3:0.99.02-3 +- Perl 5.18 rebuild +>>>>>>> fc/master + +* Tue Jul 02 2013 Jitka Plesnikova - 3:0.99.02-2 +- Specify all dependencies + +* Thu Mar 7 2013 Jitka Plesnikova - 3:0.99.02-1 +- 0.9902 bump + +* Thu Feb 14 2013 Fedora Release Engineering - 3:0.99.01-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Sep 17 2012 Jitka Plesnikova - 3:0.99.01-1 +- 0.9901 bump + +* Tue Aug 28 2012 Jitka Plesnikova - 3:0.99-241 +- Add test BR perl(Test::Harness) +- Remove %%defattr + +* Fri Aug 17 2012 Petr Pisar - 3:0.99-240 +- Increase release to replace perl sub-package (bug #848961) + +* Fri Aug 17 2012 Petr Pisar - 3:0.99-1 +- 0.99 bump + +* Fri Jul 20 2012 Fedora Release Engineering - 3:0.88-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jun 06 2012 Petr Pisar - 3:0.88-9 +- Perl 5.16 rebuild + +* Thu May 31 2012 Petr Pisar - 3:0.88-8 +- Fix dependencies + +* Sat Jan 14 2012 Fedora Release Engineering - 3:0.88-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Aug 16 2011 Marcela Mašláňová - 3:0.88-6 +- change path on vendor, so our debuginfo are not conflicting with + perl core debuginfos + +* Sun Jul 24 2011 Iain Arnell 3:0.88-5 +- update filtering for rpm 4.9 + +* Fri Jun 17 2011 Marcela Mašláňová - 3:0.88-4 +- Perl mass rebuild + +* Fri Apr 08 2011 Petr Pisar - 3:0.88-3 +- Unexport private version::vxs module (bug #633775) +- Remove BuildRoot stuff + +* Wed Feb 09 2011 Fedora Release Engineering - 3:0.88-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Jan 26 2011 Paul Howarth 3:0.88-1 +- Update to 0.88 +- Revert to Makefile.PL flow as upstream dropped Build.PL to avoid circular + dependencies +- Install into perl directories rather than vendor directories +- Mark Pod files as %%doc + +* Tue Mar 09 2010 Marcela Mašláňová 3:0.82-1 +- Specfile autogenerated by cpanspec 1.78.