rpms/hunspell/devel hunspell-1.1.4-defaultdictfromlang.patch, NONE, 1.1 hunspell.spec, 1.2, 1.3

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Nov 29 19:45:26 UTC 2006


Author: caolanm

Update of /cvs/dist/rpms/hunspell/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv10268

Modified Files:
	hunspell.spec 
Added Files:
	hunspell-1.1.4-defaultdictfromlang.patch 
Log Message:
take locale for default dictionary

hunspell-1.1.4-defaultdictfromlang.patch:
 hunspell.cxx |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletion(-)

--- NEW FILE hunspell-1.1.4-defaultdictfromlang.patch ---
--- hunspell-1.1.4/src/tools/hunspell.cxx.orig	2006-11-29 12:09:52.000000000 +0000
+++ hunspell-1.1.4/src/tools/hunspell.cxx	2006-11-29 12:24:36.000000000 +0000
@@ -1105,7 +1105,20 @@
         if (printgood && (filter_mode == NORMAL)) filter_mode = BADWORD;
 
 	if (! dicname) {
-		if (! (dicname=getenv("DICTIONARY"))) dicname = mystrdup("default");
+		if (! (dicname=getenv("DICTIONARY"))) { 
+		        if (! (dicname=getenv("LANG"))) { 
+                                dicname = mystrdup("default");
+                        }
+                        else {
+			        int len = strlen(dicname);
+			        for (int i = 0; i < len; ++i) {
+			            if (dicname[i] == '_') && (i+2 < len) {
+			                    dicname[i+2] = 0;
+			                    break;
+			            }
+                                }
+                        }
+                }
 	}
 
 	if (!privdicname) privdicname = mystrdup(getenv("WORDLIST"));


Index: hunspell.spec
===================================================================
RCS file: /cvs/dist/rpms/hunspell/devel/hunspell.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- hunspell.spec	28 Nov 2006 17:13:58 -0000	1.2
+++ hunspell.spec	29 Nov 2006 19:45:24 -0000	1.3
@@ -1,7 +1,7 @@
 Name: hunspell
 Summary: Hunspell is a spell checker and morphological analyzer library
 Version: 1.1.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 Source: %{name}-%{version}.tar.gz
 Group: System Environment/Libraries
 URL: http://hunspell.sourceforge.net/
@@ -9,6 +9,7 @@
 License: LGPL
 BuildRequires: libtool
 Patch0: hunspell-1.1.4-sharedlibs.patch
+Patch1: hunspell-1.1.4-defaultdictfromlang.patch
 
 %description
 Hunspell is a spell checker and morphological analyzer library and program 
@@ -27,6 +28,7 @@
 %prep
 %setup -q
 %patch0 -p1 -b .sharedlibs.patch
+%patch1 -p1 -b .defaultdictfromlang.patch
 
 %build
 libtoolize --automake --force
@@ -77,5 +79,9 @@
 %{_bindir}/unmunch
 
 %changelog
+* Wed Nov 29 2006 Caolan McNamara <caolanm at redhat.com> - 1.1.4-2
+- add hunspell-1.1.4-defaultdictfromlang.patch to take locale as default
+  dictionary
+
 * Wed Oct 25 2006 Caolan McNamara <caolanm at redhat.com> - 1.1.4-1
 - initial version




More information about the fedora-cvs-commits mailing list