[perl-Syntax-Highlight-Engine-Kate/f18] Apply upstream case sensitivity patch (CPAN RT#84982)

Jitka Plesnikova jplesnik at fedoraproject.org
Tue Jan 7 08:40:22 UTC 2014


commit 7f71f3d9dae708bf14bdb01598991f737e34c8c3
Author: Jitka Plesnikova <jplesnik at redhat.com>
Date:   Tue Jan 7 09:40:20 2014 +0100

    Apply upstream case sensitivity patch (CPAN RT#84982)

 ...ight-Engine-Kate-0.08-RT84982-insensitive.patch |   52 ++++++++++++++++++++
 perl-Syntax-Highlight-Engine-Kate.spec             |    8 +++-
 2 files changed, 59 insertions(+), 1 deletions(-)
---
diff --git a/Syntax-Highlight-Engine-Kate-0.08-RT84982-insensitive.patch b/Syntax-Highlight-Engine-Kate-0.08-RT84982-insensitive.patch
new file mode 100644
index 0000000..9bfdff7
--- /dev/null
+++ b/Syntax-Highlight-Engine-Kate-0.08-RT84982-insensitive.patch
@@ -0,0 +1,52 @@
+--- Syntax-Highlight-Engine-Kate-0.07/lib/Syntax/Highlight/Engine/Kate.pm	2012-09-23 20:01:18.000000000 +1000
++++ Syntax-Highlight-Engine-Kate-inse/lib/Syntax/Highlight/Engine/Kate.pm	2013-05-02 11:47:22.117779928 +1000
+@@ -616,11 +616,30 @@
+ }
+ 
+ sub languagePlug {
+-	my ($self, $req) = @_;
++	my ($self, $req, $insensitive) = @_;
++
+ 	unless (exists($self->{'syntaxes'}->{$req})) {
+-		warn "undefined language: $req";
+-		return undef;
++		if (defined($insensitive) && $insensitive) {
++			my $matched = 0;
++			foreach my $key (keys(%{$self->{'syntaxes'}})) {
++				if ($key =~ /^$req$/i) {
++					warn "substituting language $key for $req";
++					$req = $key;
++					$matched = 1;
++					last;
++				}
++			}
++
++			unless ($matched) {
++				warn "undefined language: $req";
++				return undef;
++			}
++		} else {
++			warn "undefined language: $req";
++			return undef;
++		}
+ 	}
++
+ 	return $self->{'syntaxes'}->{$req};
+ }
+ 
+@@ -804,9 +823,13 @@
+ 
+ returns a list of languages for which plugins have been defined.
+ 
+-=item B<languagePlug>(I<$language>);
++=item B<languagePlug>(I<$language>, I<?$insensitive?>);
++
++Returns the module name of the plugin for B<$language>.
++
++If B<$insensitive> is set it will also try to match names ignoring case and return the correct module name of the plugin.
+ 
+-returns the module name of the plugin for B<$language>
++e.g. $highlighter->languagePlug('HtMl', 1); will return 'HTML'.
+ 
+ =item B<languagePropose>(I<$filename>);
+ 
diff --git a/perl-Syntax-Highlight-Engine-Kate.spec b/perl-Syntax-Highlight-Engine-Kate.spec
index 83132ed..83e069c 100644
--- a/perl-Syntax-Highlight-Engine-Kate.spec
+++ b/perl-Syntax-Highlight-Engine-Kate.spec
@@ -1,11 +1,13 @@
 Name:           perl-Syntax-Highlight-Engine-Kate
 Version:        0.08
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Port to Perl of the syntax highlight engine of the Kate text editor
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Syntax-Highlight-Engine-Kate/
 Source0:        http://www.cpan.org/authors/id/S/SZ/SZABGAB/Syntax-Highlight-Engine-Kate-%{version}.tar.gz
+# Add support case insensitive names (CPAN RT#84982)
+Patch0:         Syntax-Highlight-Engine-Kate-0.08-RT84982-insensitive.patch
 BuildArch:      noarch
 BuildRequires:  perl
 BuildRequires:  perl(Config)
@@ -44,6 +46,7 @@ engine of the Kate text editor.
 
 %prep
 %setup -q -n Syntax-Highlight-Engine-Kate-%{version}
+%patch0 -p1
 find -type f -exec chmod -c -x {} +
 
 %build
@@ -64,6 +67,9 @@ make test
 %{_mandir}/man3/*
 
 %changelog
+* Tue Jan 07 2014 Jitka Plesnikova <jplesnik at redhat.com> - 0.08-2
+- Apply upstream case sensitivity patch (CPAN RT#84982) - jfearn at redhat.com
+
 * Mon Sep 09 2013 Jitka Plesnikova <jplesnik at redhat.com> - 0.08-1
 - 0.08 bump
 - Modernize spec file


More information about the scm-commits mailing list