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

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

 



commit 896bbe67ba3982d18cf54d44813dd6ff47feabad
Author: Jitka Plesnikova <jplesnik@xxxxxxxxxx>
Date:   Tue Jan 7 09:31:39 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 52d5248..a554a52 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@xxxxxxxxxx> - 0.08-2
+- Apply upstream case sensitivity patch (CPAN RT#84982) - jfearn@xxxxxxxxxx
+
 * Mon Sep 09 2013 Jitka Plesnikova <jplesnik@xxxxxxxxxx> - 0.08-1
 - 0.08 bump
 - Update dependencies
--
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