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

rpms/gdm/devel gdm-2.6.0.8-prune-lang-list.patch, NONE, 1.1 gdm.spec, 1.86, 1.87



Author: rstrode

Update of /cvs/dist/rpms/gdm/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv3939

Modified Files:
	gdm.spec 
Added Files:
	gdm-2.6.0.8-prune-lang-list.patch 
Log Message:
- add patch i forgot about to cvs
- disable patch in spec file


gdm-2.6.0.8-prune-lang-list.patch:
 daemon/gdm.in      |    4 ++++
 gui/gdmlanguages.c |   38 ++++++++++++++++++++++++++++++++++----
 2 files changed, 38 insertions(+), 4 deletions(-)

--- NEW FILE gdm-2.6.0.8-prune-lang-list.patch ---
--- gdm-2.6.0.8/gui/gdmlanguages.c.prune-lang-list	2005-03-07 13:28:05.000000000 -0500
+++ gdm-2.6.0.8/gui/gdmlanguages.c	2005-08-10 17:21:08.000000000 -0400
@@ -240,18 +240,47 @@
 gdm_lang_init (void)
 {
 	int i;
+
 	if (lang_names != NULL)
 		return;
 
 	lang_names = g_hash_table_new (g_str_hash, g_str_equal);
 
 	for (i = 0; languages[i].name != NULL; i ++) {
-		g_hash_table_insert (lang_names,
-				     languages[i].code,
-				     &languages[i]);
+	      g_hash_table_insert (lang_names,
+				   languages[i].code,
+				   &languages[i]);
+
 	}
 }
 
+static gboolean
+lang_is_installed (const char *language_code)
+{
+      const gchar * const *installed_language_codes;
+      const gchar *preferred_languages, *installed_languages;
+      int i;
+
+      preferred_languages = g_getenv ("LANGUAGE"); 
+      installed_languages = g_getenv ("SUPPORTED");
+
+      if (installed_languages != NULL)
+	    g_setenv ("LANGUAGE", installed_languages, TRUE);
+
+      installed_language_codes = g_get_language_names ();
+
+      g_setenv ("LANGUAGE", preferred_languages, TRUE);
+      i = 0;
+      while (installed_language_codes[i] != NULL) {
+		if (strcmp (language_code, installed_language_codes[i]) == 0) {
+			  return TRUE;
+		}
+		i++;
+      }
+
+return FALSE;
+}
+
 static Language *
 find_lang (const char *language, gboolean *clean)
 {
@@ -549,7 +578,8 @@
 					     language);
 		}
 
-		langs = g_list_prepend (langs, g_strdup (lang));
+                if (lang_is_installed (lang))
+			langs = g_list_prepend (langs, g_strdup (lang));
 		g_hash_table_insert (dupcheck, g_strdup (lang),
 				     GINT_TO_POINTER (1));
 
--- gdm-2.6.0.8/daemon/gdm.in.prune-lang-list	2005-08-10 17:21:50.000000000 -0400
+++ gdm-2.6.0.8/daemon/gdm.in	2005-08-10 17:22:58.000000000 -0400
@@ -22,6 +22,10 @@
         export LC_MESSAGES
     fi
 fi
+if [ -z "$SUPPORTED" ]
+then
+  test -f /etc/sysconfig/i18n && export SUPPORTED=`. /etc/sysconfig/i18n; echo $SUPPORTED`
+fi
 
 exec @EXPANDED_BINDIR@/gdm-binary "$@"
 


Index: gdm.spec
===================================================================
RCS file: /cvs/dist/rpms/gdm/devel/gdm.spec,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- gdm.spec	18 Aug 2005 17:31:37 -0000	1.86
+++ gdm.spec	18 Aug 2005 17:37:49 -0000	1.87
@@ -118,7 +118,7 @@
 %patch28 -p1 -b .xdmcp
 %patch29 -p1 -b .fix-halt-command
 %patch30 -p1 -b .process-all-messages
-%patch31 -p1 -b .prune-lang-list
+#%patch31 -p1 -b .prune-lang-list
 
 # fix the time format for ja
 perl -pi -e "s|^msgstr \"%a %b %d, %H:%M\"|msgstr \"%m/%d \(%a\) %H:%M\"|; s|^msgstr \"%a %b %d, %I:%M %p\"|msgstr \"%m/%d \(%a\) %p %I:%M\"|" po/ja.po


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