[perl-Config-IniFiles/el6] Fix el6 compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit a0e4d099d04b03afbb376fcedf5ae8176de6ca9b
Author: Lubomir Rintel <lubo.rintel@xxxxxxxxxxxx>
Date:   Fri Jun 1 14:07:31 2012 +0200

    Fix el6 compatibility

 .gitignore                           |    1 +
 perl-Config-IniFiles-2.72-el6.patch  |   52 ++++++++++++++++++++++++++++++++++
 perl-Config-IniFiles-2.72-warn.patch |   25 ++++++++++++++++
 perl-Config-IniFiles.spec            |   13 ++++++--
 4 files changed, 88 insertions(+), 3 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 56f96e5..50b5e6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 Config-IniFiles-2.47.tar.gz
+/Config-IniFiles-2.72.tar.gz
diff --git a/perl-Config-IniFiles-2.72-el6.patch b/perl-Config-IniFiles-2.72-el6.patch
new file mode 100644
index 0000000..c1be389
--- /dev/null
+++ b/perl-Config-IniFiles-2.72-el6.patch
@@ -0,0 +1,52 @@
+From 53d46071471820e0f18b5f5cd439e24cb7f94678 Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lubo.rintel@xxxxxxxxxxxx>
+Date: Fri, 1 Jun 2012 13:55:39 +0200
+Subject: [PATCH 1/2] Older List::MoreUtils provide no 'none' function
+
+---
+ lib/Config/IniFiles.pm |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Config/IniFiles.pm b/lib/Config/IniFiles.pm
+index 32a496e..1ababa2 100644
+--- a/lib/Config/IniFiles.pm
++++ b/lib/Config/IniFiles.pm
+@@ -11,7 +11,7 @@ use Carp;
+ use Symbol 'gensym','qualify_to_ref';   # For the 'any data type' hack
+ use Fcntl qw( SEEK_SET SEEK_CUR );
+ 
+-use List::MoreUtils qw(any none);
++use List::MoreUtils qw(any);
+ 
+ use File::Basename qw( dirname );
+ use File::Temp qw/ tempfile /;
+@@ -687,7 +687,7 @@ sub newval {
+ 
+     $self->AddSection($sect);
+ 
+-    if (none { $_ eq $parm } @{$self->{parms}{$sect}})
++    if (not grep { $_ eq $parm } @{$self->{parms}{$sect}})
+     {
+         CORE::push(@{$self->{parms}{$sect}}, $parm)
+     }
+@@ -1394,7 +1394,7 @@ sub _touch_section {
+ 
+     $self->{mysects} ||= [];
+ 
+-    if (none { $_ eq $sect } @{$self->{mysects}})
++    if (not grep { $_ eq $sect } @{$self->{mysects}})
+     {
+         CORE::push @{$self->{mysects}}, $sect;
+     }
+@@ -1535,7 +1535,7 @@ sub _SetGroupMember_helper
+         $self->{group}{$group} = [];
+     }
+ 
+-    if (none {$_ eq $sect} @{$self->{group}{$group}}) {
++    if (not grep {$_ eq $sect} @{$self->{group}{$group}}) {
+         CORE::push @{$self->{group}{$group}}, $sect;
+     }
+ 
+-- 
+1.7.1
+
diff --git a/perl-Config-IniFiles-2.72-warn.patch b/perl-Config-IniFiles-2.72-warn.patch
new file mode 100644
index 0000000..98bd8d0
--- /dev/null
+++ b/perl-Config-IniFiles-2.72-warn.patch
@@ -0,0 +1,25 @@
+From 688ed6edbc7d94181657de0de2ac9dc1ea5a20da Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lubo.rintel@xxxxxxxxxxxx>
+Date: Fri, 1 Jun 2012 13:52:38 +0200
+Subject: [PATCH 2/2] Get rid of a warning
+
+---
+ lib/Config/IniFiles.pm |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/Config/IniFiles.pm b/lib/Config/IniFiles.pm
+index 1ababa2..281c78c 100644
+--- a/lib/Config/IniFiles.pm
++++ b/lib/Config/IniFiles.pm
+@@ -823,7 +823,7 @@ sub _no_filename
+ {
+     my $self = shift;
+ 
+-    return not length $self->{cf};
++    return not length ($self->{cf} || '');
+ }
+ 
+ sub _read_line_num
+-- 
+1.7.1
+
diff --git a/perl-Config-IniFiles.spec b/perl-Config-IniFiles.spec
index 24b491c..58eeb37 100644
--- a/perl-Config-IniFiles.spec
+++ b/perl-Config-IniFiles.spec
@@ -1,6 +1,6 @@
 Name:           perl-Config-IniFiles
 Version:        2.72
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A module for reading .ini-style configuration files
 
 Group:          Development/Libraries
@@ -9,6 +9,9 @@ URL:            http://search.cpan.org/dist/Config-IniFiles/
 Source0:        http://www.cpan.org/authors/id/S/SH/SHLOMIF/Config-IniFiles-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+Patch0:         perl-Config-IniFiles-2.72-el6.patch
+Patch1:         perl-Config-IniFiles-2.72-warn.patch
+
 BuildRequires:  perl(Module::Build::Compat)
 BuildRequires:  perl(ExtUtils::MakeMaker)
 BuildRequires:  perl(Test::More)
@@ -27,6 +30,8 @@ from a tied hash.
 
 %prep
 %setup -q -n Config-IniFiles-%{version}
+%patch0 -p1
+%patch1 -p1
 
 %build
 %{__perl} Makefile.PL INSTALLDIRS=vendor
@@ -42,9 +47,7 @@ chmod -R u+w $RPM_BUILD_ROOT/*
 
 
 %check
-%if 0%{?fedora}
 make test
-%endif
 
 
 %clean
@@ -59,6 +62,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Jun 01 2012 Lubomir Rintel (GoodData) <lubo.rintel@xxxxxxxxxxxx> - 2.72-2
+- Fix compatibility with el6
+- Enable test suite
+
 * Fri May 11 2012 Tom Callaway <spot@xxxxxxxxxxxxxxxxx> - 2.72-1
 - update to 2.72
 - notable fix: SECURITY BUG FIX: Config::IniFiles used to write 
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel



[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux