From 2cddc08779607d4d3971a3ff3af0e7d60eedc87e Mon Sep 17 00:00:00 2001
From: Emmanuel Seyman <emman...@seyman.fr>
Date: Fri, 28 Jul 2017 10:38:44 +0200
Subject: Update to 2.45

---
 .gitignore                                         |   1 +
 ...ct-JSON-encode-decode-availability-by-VER.patch |  52 -----
 CGI-Ex-2.44-Do-not-use-POSIX-tmpnam.patch          | 216 ---------------------
 perl-CGI-Ex.spec                                   |  14 +-
 sources                                            |   2 +-
 5 files changed, 8 insertions(+), 277 deletions(-)
 delete mode 100644 
CGI-Ex-2.44-Do-not-detect-JSON-encode-decode-availability-by-VER.patch
 delete mode 100644 CGI-Ex-2.44-Do-not-use-POSIX-tmpnam.patch

diff --git a/.gitignore b/.gitignore
index 498b574..21bfef4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ CGI-Ex-2.32.tar.gz
 /CGI-Ex-2.42.tar.gz
 /CGI-Ex-2.43.tar.gz
 /CGI-Ex-2.44.tar.gz
+/CGI-Ex-2.45.tar.gz
diff --git 
a/CGI-Ex-2.44-Do-not-detect-JSON-encode-decode-availability-by-VER.patch 
b/CGI-Ex-2.44-Do-not-detect-JSON-encode-decode-availability-by-VER.patch
deleted file mode 100644
index 4acd4eb..0000000
--- a/CGI-Ex-2.44-Do-not-detect-JSON-encode-decode-availability-by-VER.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 50e59055f733a78d4c3efb443e4020d7177c2344 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
-Date: Thu, 25 May 2017 17:19:31 +0200
-Subject: [PATCH] Do not detect JSON::encode/decode availability by VERSION
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-JSON-2.93 broke JSON->VERSON()
-<https://rt.cpan.org/Public/Bug/Display.html?id=121892> and that
-breaks JSON handling in CGI::Ex::Conf.
-
-This patch changes JSON->VERSION() to JSON->can() that should work
-always.
-
-Signed-off-by: Petr Písař <ppi...@redhat.com>
----
- lib/CGI/Ex/Conf.pm | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/lib/CGI/Ex/Conf.pm b/lib/CGI/Ex/Conf.pm
-index c9d26f1..e422d9d 100644
---- a/lib/CGI/Ex/Conf.pm
-+++ b/lib/CGI/Ex/Conf.pm
-@@ -263,7 +263,7 @@ sub read_handler_json {
-   CORE::read(IN, my $text, -s $file);
-   close IN;
-   require JSON;
--  my $decode = JSON->VERSION > 1.98 ? 'decode' : 'jsonToObj';
-+  my $decode = JSON->can('decode') ? 'decode' : 'jsonToObj';
-   return scalar JSON->new->$decode($text);
- }
- 
-@@ -547,13 +547,13 @@ sub write_handler_json {
-   my $ref  = shift;
-   require JSON;
-   my $str;
--  if (JSON->VERSION > 1.98) {
-+  if (JSON->can('encode')) {
-       my $j = JSON->new;
-       $j->canonical(1);
-       $j->pretty;
-       $str = $j->encode($ref);
-   } else {
--      $str = JSON->new->objToJSon($ref, {pretty => 1, indent => 2});
-+      $str = JSON->new->objToJson($ref, {pretty => 1, indent => 2});
-   }
-   local *OUT;
-   open (OUT, ">$file") || die $!;
--- 
-2.9.4
-
diff --git a/CGI-Ex-2.44-Do-not-use-POSIX-tmpnam.patch 
b/CGI-Ex-2.44-Do-not-use-POSIX-tmpnam.patch
deleted file mode 100644
index 1b456b8..0000000
--- a/CGI-Ex-2.44-Do-not-use-POSIX-tmpnam.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-From 08e6f1c89b1c1fb8250a08be9db4d3ce869d7fa5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
-Date: Thu, 25 May 2017 15:23:15 +0200
-Subject: [PATCH] Do not use POSIX::tmpnam()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Perl 5.26.0 removed POSIX::tmpnam().
-
-Signed-off-by: Petr Písař <ppi...@redhat.com>
----
- Makefile.PL                             |  1 +
- samples/benchmark/bench_conf_readers.pl | 22 +++++++++++-----------
- samples/benchmark/bench_conf_writers.pl |  9 ++++-----
- samples/devel/dprof_conf.d              |  6 +++---
- t/3_conf_00_base.t                      |  6 +++---
- 5 files changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/Makefile.PL b/Makefile.PL
-index 8c9e4e9..d59ff8a 100644
---- a/Makefile.PL
-+++ b/Makefile.PL
-@@ -12,6 +12,7 @@ WriteMakefile(
-               VERSION_FROM  => "lib/CGI/Ex.pm",
-               INSTALLDIRS   => 'site',
-               PREREQ_PM     => {
-+                  'File::Temp'      => '0',
-                   'Template::Alloy' => '1.016',
-               },
- 
-diff --git a/samples/benchmark/bench_conf_readers.pl 
b/samples/benchmark/bench_conf_readers.pl
-index 845c807..29404e6 100644
---- a/samples/benchmark/bench_conf_readers.pl
-+++ b/samples/benchmark/bench_conf_readers.pl
-@@ -4,7 +4,7 @@ use strict;
- use vars qw($PLACEHOLDER);
- use Benchmark qw(cmpthese timethese);
- use CGI::Ex::Conf;
--use POSIX qw(tmpnam);
-+use File::Temp ();
- 
- $PLACEHOLDER = chr(186).'~'.chr(186);
- 
-@@ -223,7 +223,7 @@ my $conf = eval $str;
- my %TESTS = ();
- 
- ### do perl
--my $file = tmpnam(). '.pl';
-+my $file = File::Temp->new(SUFFIX => '.pl');
- open OUT, ">$file";
- print OUT $str;
- close OUT;
-@@ -233,7 +233,7 @@ $TESTS{pl} = sub {
- $files{pl} = $file;
- 
- ### do a generic conf_write
--#my $file2 = tmpnam(). '.g_conf';
-+#my $file2 = File::Temp->new(SUFFIX => '.g_conf');
- #&generic_conf_write($file2, $conf);
- #local $CGI::Ex::Conf::EXT_READERS{g_conf} = \&generic_conf_read;
- #$TESTS{g_conf} = sub {
-@@ -243,7 +243,7 @@ $files{pl} = $file;
- 
- 
- if (eval {require JSON}) {
--  my $_file = tmpnam(). '.json';
-+  my $_file = File::Temp->new(SUFFIX => '.json');
-   my $str = JSON::objToJson($conf, {pretty => 1, indent => 2});
-   open(my $fh, ">$_file");
-   print $fh $str;
-@@ -261,7 +261,7 @@ if (eval {require JSON}) {
- 
- ### load in the rest of the tests that we support
- if (eval {require Storable}) {
--  my $_file = tmpnam(). '.sto';
-+  my $_file = File::Temp->new(SUFFIX => '.sto');
-   &Storable::store($conf, $_file);
-   $TESTS{sto} = sub {
-     my $hash = $cob->read_ref($_file);
-@@ -270,7 +270,7 @@ if (eval {require Storable}) {
- }
- 
- if (eval {require Storable}) {
--  my $_file = tmpnam(). '.sto2';
-+  my $_file = File::Temp->new(SUFFIX => '.sto2');
-   &Storable::store($conf, $_file);
-   $TESTS{sto2} = sub {
-     my $hash = &Storable::retrieve($_file);
-@@ -279,7 +279,7 @@ if (eval {require Storable}) {
- }
- 
- if (eval {require YAML}) {
--  my $_file = tmpnam(). '.yaml';
-+  my $_file = File::Temp->new(SUFFIX => '.yaml');
-   &YAML::DumpFile($_file, $conf);
-   $TESTS{yaml} = sub {
-     my $hash = $cob->read_ref($_file);
-@@ -288,7 +288,7 @@ if (eval {require YAML}) {
- }
- 
- if (eval {require YAML}) {
--  my $_file = tmpnam(). '.yaml2';
-+  my $_file = File::Temp->new(SUFFIX => '.yaml2');
-   &YAML::DumpFile($_file, $conf);
-   $TESTS{yaml2} = sub {
-     my $hash = &YAML::LoadFile($_file);
-@@ -297,7 +297,7 @@ if (eval {require YAML}) {
- }
- 
- if (eval {require YAML}) {
--  my $_file = tmpnam(). '.yaml';
-+  my $_file = File::Temp->new(SUFFIX => '.yaml');
-   &YAML::DumpFile($_file, $conf);
-   $cob->preload_files($_file);
-   $TESTS{yaml3} = sub {
-@@ -307,7 +307,7 @@ if (eval {require YAML}) {
- }
- 
- if (eval {require Config::IniHash}) {
--  my $_file = tmpnam(). '.ini';
-+  my $_file = File::Temp->new(SUFFIX => '.ini');
-   &Config::IniHash::WriteINI($_file, $conf);
-   $TESTS{ini} = sub {
-     local $^W = 0;
-@@ -317,7 +317,7 @@ if (eval {require Config::IniHash}) {
- }
- 
- if (eval {require XML::Simple}) {
--  my $_file = tmpnam(). '.xml';
-+  my $_file = File::Temp->new(SUFFIX => '.xml');
-   my $xml = XML::Simple->new->XMLout($conf);
-   open  OUT, ">$_file" || die $!;
-   print OUT $xml;
-diff --git a/samples/benchmark/bench_conf_writers.pl 
b/samples/benchmark/bench_conf_writers.pl
-index 37b1070..6ecdb40 100644
---- a/samples/benchmark/bench_conf_writers.pl
-+++ b/samples/benchmark/bench_conf_writers.pl
-@@ -4,7 +4,7 @@ use strict;
- use vars qw($PLACEHOLDER);
- use Benchmark qw(cmpthese timethese);
- use CGI::Ex::Conf;
--use POSIX qw(tmpnam);
-+use File::Temp ();
- 
- $PLACEHOLDER = chr(186).'~'.chr(186);
- 
-@@ -75,8 +75,8 @@ my $conf = eval $str;
- my %TESTS = ();
- 
- ### do perl
--my $dir = tmpnam;
--mkdir $dir, 0755;
-+my $dir = File::Temp->newdir();
-+chmod 0755, $dir;
- my $tmpnam = "$dir/bench";
- my $file = $tmpnam. '.pl';
- $TESTS{pl} = sub {
-@@ -95,7 +95,7 @@ $files{g_conf} = $file2;
- 
- ### load in the rest of the tests that we support
- if (eval {require JSON}) {
--  my $_file = tmpnam(). '.json';
-+  my $_file = $tmpnam. '.json';
-   $TESTS{json} = sub {
-     $cob->write_ref($file, $str);
-   };
-@@ -169,7 +169,6 @@ cmpthese timethese ($n, \%TESTS);
- 
- ### comment out this line to inspect files
- unlink $_ foreach values %files;
--rmdir $dir;
- 
- ###----------------------------------------------------------------###
- 
-diff --git a/samples/devel/dprof_conf.d b/samples/devel/dprof_conf.d
-index a99369c..dd5cf6b 100644
---- a/samples/devel/dprof_conf.d
-+++ b/samples/devel/dprof_conf.d
-@@ -2,12 +2,12 @@
- # run with perl -d:DProf $0
- 
- use CGI::Ex::Conf qw(conf_read conf_write);
--use POSIX qw(tmpnam);
-+use File::Temp ();
- use Data::Dumper qw(Dumper);
- 
- #my $cob = CGI::Ex::Conf->new;
--my $tmp = tmpnam .".sto";
--END { unlink $tmp };
-+my $tmp_obj = File::Temp->new(SUFFIX => ".sto");
-+my $tmp = $tmp_obj->filename;
- 
- my $conf = {
-     one   => 1,
-diff --git a/t/3_conf_00_base.t b/t/3_conf_00_base.t
-index e41d897..f3146da 100644
---- a/t/3_conf_00_base.t
-+++ b/t/3_conf_00_base.t
-@@ -8,10 +8,10 @@
- 
- use strict;
- use Test::More tests => 8;
--use POSIX qw(tmpnam);
-+use File::Temp ();
- 
--my $file = tmpnam;
--END { unlink $file };
-+my $fileobject = File::Temp->new;
-+my $file = $fileobject->filename;
- 
- use_ok('CGI::Ex::Conf');
- 
--- 
-2.9.4
-
diff --git a/perl-CGI-Ex.spec b/perl-CGI-Ex.spec
index effbcc2..e5799c3 100644
--- a/perl-CGI-Ex.spec
+++ b/perl-CGI-Ex.spec
@@ -1,15 +1,11 @@
 Name:           perl-CGI-Ex
-Version:        2.44
-Release:        7%{?dist}
+Version:        2.45
+Release:        1%{?dist}
 Summary:        CGI utility suite - makes powerful application writing fun and 
easy
 License:        GPL+ or Artistic
 
 URL:            http://search.cpan.org/dist/CGI-Ex/
 Source0:        
http://www.cpan.org/authors/id/L/LJ/LJEPSON/CGI-Ex-%{version}.tar.gz
-# Restore compatibility with Perl 5.26.0, CPAN RT#121889
-Patch0:         CGI-Ex-2.44-Do-not-use-POSIX-tmpnam.patch
-# Adapt to changes in JSON-2.93, CPAN RT#121893
-Patch1:         
CGI-Ex-2.44-Do-not-detect-JSON-encode-decode-availability-by-VER.patch
 BuildArch:      noarch
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo 
$version))
 
@@ -61,8 +57,6 @@ CGI::Ex::App.
 
 %prep
 %setup -q -n CGI-Ex-%{version}
-%patch0 -p1
-%patch1 -p1
 
 # make rpmlint happy :)
 find samples/ -type f -exec chmod -c -x {} \;
@@ -87,6 +81,10 @@ make test
 %{_mandir}/man3/CGI*
 
 %changelog
+* Fri Jul 28 2017 Emmanuel Seyman <emman...@seyman.fr> - 2.45-1
+- Update to 2.45
+- Drop upstreamed patches
+
 * Thu Jul 27 2017 Fedora Release Engineering <rel...@fedoraproject.org> - 
2.44-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
 
diff --git a/sources b/sources
index 03f5c43..79e4cc5 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b6c4723cf7c64606cc43310f7b54e830  CGI-Ex-2.44.tar.gz
+SHA512 (CGI-Ex-2.45.tar.gz) = 
6c212fc5a4b68f54f5a6df3574b5b7698a3a667bf617812adc8d30f564ea5d2ae525d366a4b85251ddc24b527eb8c4b619e478f28f67303de8cd328576b8ae80
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-CGI-Ex.git/commit/?h=master&id=2cddc08779607d4d3971a3ff3af0e7d60eedc87e
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to