[arch-commits] Commit in gconf/repos (6 files)

Jan de Groot jgc at archlinux.org
Wed Mar 18 21:03:43 UTC 2009


    Date: Wednesday, March 18, 2009 @ 17:03:43
  Author: jgc
Revision: 30313

Merged revisions 30312 via svnmerge from 
svn+ssh://svn.archlinux.org/srv/svn-packages/gconf/trunk

........
  r30312 | jgc | 2009-03-18 21:03:31 +0000 (Wed, 18 Mar 2009) | 4 lines
  
  upgpkg: gconf 2.26.0-2
      Implement gettext domain support from Ubuntu. Shrinks schema files by several megabytes
  Fix default configuration path
  Create conf.xml.system with correct permissions
........

Added:
  gconf/repos/testing-x86_64/01_xml-gettext-domain.patch
    (from rev 30312, gconf/trunk/01_xml-gettext-domain.patch)
  gconf/repos/testing-x86_64/05_from_vuntz_gconf2-pk-default-path.patch
    (from rev 30312, gconf/trunk/05_from_vuntz_gconf2-pk-default-path.patch)
Modified:
  gconf/repos/testing-x86_64/	(properties)
  gconf/repos/testing-x86_64/PKGBUILD
  gconf/repos/testing-x86_64/gconf-merge-schema
  gconf/repos/testing-x86_64/gconf.install

--------------------------------------------+
 01_xml-gettext-domain.patch                |  299 +++++++++++++++++++++++++++
 05_from_vuntz_gconf2-pk-default-path.patch |   12 +
 PKGBUILD                                   |   17 +
 gconf-merge-schema                         |   22 +
 gconf.install                              |   15 -
 5 files changed, 343 insertions(+), 22 deletions(-)


Property changes on: gconf/repos/testing-x86_64
___________________________________________________________________
Modified: svnmerge-integrated
   - /gconf/trunk:1-30211
   + /gconf/trunk:1-30312

Copied: gconf/repos/testing-x86_64/01_xml-gettext-domain.patch (from rev 30312, gconf/trunk/01_xml-gettext-domain.patch)
===================================================================
--- testing-x86_64/01_xml-gettext-domain.patch	                        (rev 0)
+++ testing-x86_64/01_xml-gettext-domain.patch	2009-03-18 21:03:43 UTC (rev 30313)
@@ -0,0 +1,299 @@
+# Description: Support calling gettext at runtime and putting the gettext domain into the .schemas file instead of replicating translations in /usr/share/gconf/schemas/*.schemas *and* /var/lib/gconf/defaults/%gconf-tree-$LANG.xml. This saves in the order of 90 MB uncompressed/10 MB compressed on hard disks.
+# Ubuntu: https://bugs.launchpad.net/bugs/123025
+# Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=568845
+diff -Nur -x '*.orig' -x '*~' gconf-2.25.0/backends/markup-tree.c gconf-2.25.0.new/backends/markup-tree.c
+--- gconf-2.25.0/backends/markup-tree.c	2009-01-10 05:55:08.000000000 +0100
++++ gconf-2.25.0.new/backends/markup-tree.c	2009-01-23 12:11:48.000000000 +0100
+@@ -52,6 +52,7 @@
+   char       *schema_name;
+   char       *mod_user;
+   GTime       mod_time;
++  char       *gettext_domain;
+ };
+ 
+ static LocalSchemaInfo* local_schema_info_new  (void);
+@@ -1351,6 +1352,7 @@
+     gconf_value_free (entry->value);
+   g_free (entry->schema_name);
+   g_free (entry->mod_user);
++  g_free (entry->gettext_domain);
+ 
+   g_slist_foreach (entry->local_schemas,
+                    (GFunc) local_schema_info_free,
+@@ -1593,6 +1595,8 @@
+                              gconf_schema_get_type (schema));
+       gconf_schema_set_owner (current_schema,
+                               gconf_schema_get_owner (schema));
++      gconf_schema_set_gettext_domain (current_schema,
++                              gconf_schema_get_gettext_domain (schema));
+     }
+ 
+   /* Update mod time */
+@@ -1805,6 +1809,8 @@
+       else if (c_local_schema && c_local_schema->long_desc)
+         gconf_schema_set_long_desc (schema, c_local_schema->long_desc);
+ 
++      gconf_schema_set_gettext_domain (schema, entry->gettext_domain);
++
+       return retval;
+     }
+ }
+@@ -2339,8 +2345,9 @@
+   const char *ltype;
+   const char *list_type;
+   const char *owner;
++
+   GConfValueType vtype;
+-  const char *dummy1, *dummy2, *dummy3, *dummy4;
++  const char *dummy1, *dummy2, *dummy3, *dummy4, *dummy5;
+   
+ #if 0
+   g_assert (ELEMENT_IS ("entry") ||
+@@ -2377,6 +2384,7 @@
+                           "muser", &dummy2,
+                           "mtime", &dummy3,
+                           "schema", &dummy4,
++                          "gettext_domain", &dummy5,
+ 
+                           NULL))
+     return;
+@@ -2682,6 +2690,7 @@
+       const char *mtime;
+       const char *schema;
+       const char *type;
++      const char *gettext_domain;
+       const char *dummy1, *dummy2, *dummy3, *dummy4;
+       const char *dummy5, *dummy6, *dummy7;
+       GConfValue *value;
+@@ -2692,6 +2701,7 @@
+       mtime = NULL;
+       schema = NULL;
+       type = NULL;
++      gettext_domain = NULL;
+ 
+       if (!locate_attributes (context, element_name, attribute_names, attribute_values,
+                               error,
+@@ -2700,6 +2710,7 @@
+                               "mtime", &mtime,
+                               "schema", &schema,
+                               "type", &type,
++                              "gettext_domain", &gettext_domain,
+                           
+                               /* These are allowed but we don't use them until
+                                * parse_value_element
+@@ -2767,6 +2778,9 @@
+        */
+       if (schema)
+         entry->schema_name = g_strdup (schema);
++
++      if (gettext_domain)
++        entry->gettext_domain = g_strdup (gettext_domain);
+     }
+   else
+     {
+@@ -3705,6 +3719,7 @@
+         GConfSchema *schema;
+         GConfValueType stype;
+         const char *owner;
++        const char *gettext_domain;
+         
+         schema = gconf_value_get_schema (value);
+ 
+@@ -3730,6 +3745,23 @@
+             
+             g_free (s);
+           }
++
++        gettext_domain = gconf_schema_get_gettext_domain (schema);
++        
++        if (gettext_domain)
++          {
++            char *s;
++
++            s = g_markup_escape_text (gettext_domain, -1);
++            
++            if (fprintf (f, " gettext_domain=\"%s\"", s) < 0)
++              {
++                g_free (s);
++                return FALSE;
++              }
++            
++            g_free (s);
++          }
+         
+         if (stype == GCONF_VALUE_LIST)
+           {
+diff -Nur -x '*.orig' -x '*~' gconf-2.25.0/gconf/gconf-schema.c gconf-2.25.0.new/gconf/gconf-schema.c
+--- gconf-2.25.0/gconf/gconf-schema.c	2009-01-10 05:55:07.000000000 +0100
++++ gconf-2.25.0.new/gconf/gconf-schema.c	2009-01-23 12:11:48.000000000 +0100
+@@ -35,6 +35,7 @@
+   gchar* owner;        /* Name of creating application */
+   gchar* short_desc;   /* 40 char or less description, no newlines */
+   gchar* long_desc;    /* could be a paragraph or so */
++  gchar* gettext_domain; /* description gettext domain */
+   GConfValue* default_value; /* Default value of the key */
+ } GConfRealSchema;
+ 
+@@ -63,6 +64,7 @@
+   g_free (real->locale);
+   g_free (real->short_desc);
+   g_free (real->long_desc);
++  g_free (real->gettext_domain);
+   g_free (real->owner);
+ 
+   if (real->default_value)
+@@ -91,6 +93,8 @@
+ 
+   dest->long_desc = g_strdup (real->long_desc);
+ 
++  dest->gettext_domain = g_strdup (real->gettext_domain);
++
+   dest->owner = g_strdup (real->owner);
+ 
+   dest->default_value = real->default_value ? gconf_value_copy (real->default_value) : NULL;
+@@ -136,6 +140,20 @@
+     REAL_SCHEMA (sc)->locale = NULL;
+ }
+ 
++void
++gconf_schema_set_gettext_domain (GConfSchema* sc, const gchar* domain)
++{
++  g_return_if_fail (domain == NULL || g_utf8_validate (domain, -1, NULL));
++  
++  if (REAL_SCHEMA (sc)->gettext_domain)
++    g_free (REAL_SCHEMA (sc)->gettext_domain);
++
++  if (domain)
++    REAL_SCHEMA (sc)->gettext_domain = g_strdup (domain);
++  else 
++    REAL_SCHEMA (sc)->gettext_domain = NULL;
++}
++
+ void          
+ gconf_schema_set_short_desc (GConfSchema* sc, const gchar* desc)
+ {
+@@ -228,6 +246,14 @@
+       return FALSE;
+     }
+ 
++  if (real->gettext_domain && !g_utf8_validate (real->gettext_domain, -1, NULL))
++    {
++      g_set_error (err, GCONF_ERROR,
++                   GCONF_ERROR_FAILED,
++                   _("Schema contains invalid UTF-8"));
++      return FALSE;
++    }
++
+   if (real->owner && !g_utf8_validate (real->owner, -1, NULL))
+     {
+       g_set_error (err, GCONF_ERROR,
+@@ -299,11 +325,22 @@
+ }
+ 
+ const char*
++gconf_schema_get_gettext_domain (const GConfSchema *schema)
++{
++  g_return_val_if_fail (schema != NULL, NULL);
++
++  return REAL_SCHEMA (schema)->gettext_domain;
++}
++
++const char*
+ gconf_schema_get_short_desc (const GConfSchema *schema)
+ {
+   g_return_val_if_fail (schema != NULL, NULL);
+ 
+-  return REAL_SCHEMA (schema)->short_desc;
++ if (REAL_SCHEMA (schema)->gettext_domain)
++    return g_dgettext(REAL_SCHEMA (schema)->gettext_domain, REAL_SCHEMA (schema)->short_desc);
++  else
++    return REAL_SCHEMA (schema)->short_desc;
+ }
+ 
+ const char*
+@@ -311,7 +348,10 @@
+ {
+   g_return_val_if_fail (schema != NULL, NULL);
+ 
+-  return REAL_SCHEMA (schema)->long_desc;
++  if (REAL_SCHEMA (schema)->gettext_domain)
++    return dgettext(REAL_SCHEMA (schema)->gettext_domain, REAL_SCHEMA (schema)->long_desc);
++  else
++    return REAL_SCHEMA (schema)->long_desc;
+ }
+ 
+ const char*
+diff -Nur -x '*.orig' -x '*~' gconf-2.25.0/gconf/gconf-schema.h gconf-2.25.0.new/gconf/gconf-schema.h
+--- gconf-2.25.0/gconf/gconf-schema.h	2009-01-10 05:55:07.000000000 +0100
++++ gconf-2.25.0.new/gconf/gconf-schema.h	2009-01-23 12:11:48.000000000 +0100
+@@ -48,6 +48,8 @@
+                                             GConfValueType  type);
+ void gconf_schema_set_locale               (GConfSchema    *sc,
+                                             const gchar    *locale);
++void gconf_schema_set_gettext_domain       (GConfSchema    *sc,
++                                            const gchar    *domain);
+ void gconf_schema_set_short_desc           (GConfSchema    *sc,
+                                             const gchar    *desc);
+ void gconf_schema_set_long_desc            (GConfSchema    *sc,
+@@ -65,6 +67,7 @@
+ GConfValueType gconf_schema_get_car_type      (const GConfSchema *schema);
+ GConfValueType gconf_schema_get_cdr_type      (const GConfSchema *schema);
+ const char*    gconf_schema_get_locale        (const GConfSchema *schema);
++const char*    gconf_schema_get_gettext_domain(const GConfSchema *schema);
+ const char*    gconf_schema_get_short_desc    (const GConfSchema *schema);
+ const char*    gconf_schema_get_long_desc     (const GConfSchema *schema);
+ const char*    gconf_schema_get_owner         (const GConfSchema *schema);
+diff -Nur -x '*.orig' -x '*~' gconf-2.25.0/gconf/gconftool.c gconf-2.25.0.new/gconf/gconftool.c
+--- gconf-2.25.0/gconf/gconftool.c	2009-01-10 05:55:07.000000000 +0100
++++ gconf-2.25.0.new/gconf/gconftool.c	2009-01-23 12:11:48.000000000 +0100
+@@ -3293,6 +3293,7 @@
+   GConfValueType cdr_type;
+   GConfValue* global_default;
+   GHashTable* hash;
++  gchar* gettext_domain;
+ };
+ 
+ static int
+@@ -3545,6 +3546,15 @@
+               else
+                 g_printerr (_("WARNING: empty <applyto> node"));
+             }
++          else if (strcmp((char *)iter->name, "gettext_domain") == 0)
++            {
++              tmp = (char *)xmlNodeGetContent(iter);
++              if (tmp)
++                {
++                  info->gettext_domain = g_strdup(tmp);
++                  xmlFree(tmp);
++                }
++            }
+           else
+             g_printerr (_("WARNING: node <%s> not understood below <schema>\n"),
+ 			iter->name);
+@@ -3634,6 +3644,9 @@
+   if (info->owner != NULL)
+     gconf_schema_set_owner(schema, info->owner);
+ 
++  if (info->gettext_domain != NULL)
++    gconf_schema_set_gettext_domain(schema, info->gettext_domain);
++
+   xmlFree(name);
+ 
+   /* Locale-specific info */
+@@ -3763,6 +3776,7 @@
+   info.apply_to = NULL;
+   info.owner = NULL;
+   info.global_default = NULL;
++  info.gettext_domain = NULL;
+   info.hash = g_hash_table_new(g_str_hash, g_str_equal);
+   
+   extract_global_info(node, &info);
+@@ -3799,6 +3813,8 @@
+             ;  /* nothing */
+           else if (strcmp((char *)iter->name, "applyto") == 0)
+             ;  /* nothing */
++          else if (strcmp((char *)iter->name, "gettext_domain") == 0)
++            ;  /* nothing */
+           else if (strcmp((char *)iter->name, "locale") == 0)
+             {
+               process_locale_info(iter, &info);

Copied: gconf/repos/testing-x86_64/05_from_vuntz_gconf2-pk-default-path.patch (from rev 30312, gconf/trunk/05_from_vuntz_gconf2-pk-default-path.patch)
===================================================================
--- testing-x86_64/05_from_vuntz_gconf2-pk-default-path.patch	                        (rev 0)
+++ testing-x86_64/05_from_vuntz_gconf2-pk-default-path.patch	2009-03-18 21:03:43 UTC (rev 30313)
@@ -0,0 +1,12 @@
+diff -Nur -x '*.orig' -x '*~' gconf-2.25.2/defaults/gconf-defaults.c gconf-2.25.2.new/defaults/gconf-defaults.c
+--- gconf-2.25.2/defaults/gconf-defaults.c	2009-02-17 01:15:19.000000000 +0100
++++ gconf-2.25.2.new/defaults/gconf-defaults.c	2009-02-17 11:12:39.000000000 +0100
+@@ -507,7 +507,7 @@
+ 	else {
+ 		annotation_key = "org.gnome.gconf.defaults.set-system.prefix"; 
+ 		default_action = "org.gnome.gconf.defaults.set-system";
+-		dest_address = "xml:merged:" SYSGCONFDIR "/gconf.xml.system";
++		dest_address = "xml:merged:" SYSGCONFDIR "/gconf.xml.defaults";
+ 	}
+ 
+ 	for (i = 0; includes[i]; i++) {

Modified: testing-x86_64/PKGBUILD
===================================================================
--- testing-x86_64/PKGBUILD	2009-03-18 21:03:31 UTC (rev 30312)
+++ testing-x86_64/PKGBUILD	2009-03-18 21:03:43 UTC (rev 30313)
@@ -3,7 +3,7 @@
 
 pkgname=gconf
 pkgver=2.26.0
-pkgrel=1
+pkgrel=2
 pkgdesc="A configuration database system"
 arch=(i686 x86_64)
 license=('LGPL')
@@ -15,15 +15,23 @@
 source=(http://ftp.gnome.org/pub/gnome/sources/GConf/2.26/GConf-${pkgver}.tar.bz2
 	gconf-merge-schema
 	gconfpkg
-	gconf-reload.patch)
+	gconf-reload.patch
+	01_xml-gettext-domain.patch
+	05_from_vuntz_gconf2-pk-default-path.patch)
 md5sums=('b010f0de356ea093c6a73778b13de956'
-         '1412bafb06f7d8a9601c8f1c4d72cc06'
+         '240b473fa17b748fc9020caf372d936c'
          'b745f04b4121d8724c002b14a4c110b6'
-         'cfcc8e15be7b8a48de4aa34336ff6090')
+         'cfcc8e15be7b8a48de4aa34336ff6090'
+         '7438120b1865bd4880d5901a42cd080d'
+         'd9a02aee25ec04f2340f4e98963aabb0')
 
 build() {
   cd "${srcdir}/GConf-${pkgver}"
+  # Patch from fedora - reloads gconf after installing schemas
   patch -Np1 -i "${srcdir}/gconf-reload.patch" || return 1
+  # Patches from Ubuntu. Adds gettext domain support and changes default path
+  patch -Np1 -i "${srcdir}/01_xml-gettext-domain.patch" || return 1
+  patch -Np1 -i "${srcdir}/05_from_vuntz_gconf2-pk-default-path.patch" || return 1
   libtoolize --force --copy || return 1
   aclocal || return 1
   autoconf || return 1
@@ -33,6 +41,7 @@
 	      --disable-static --enable-defaults-service || return 1
   make pkglibdir=/usr/lib/GConf || return 1
   make DESTDIR="${pkgdir}" install || return 1
+  install -m755 -d "${pkgdir}/etc/gconf/gconf.xml.system" || return 1
   install -m755 "${srcdir}/gconf-merge-schema" "${pkgdir}/usr/bin/" || return 1
   install -d -m755 "${pkgdir}/usr/sbin"
   install -m755 "${srcdir}/gconfpkg" "${pkgdir}/usr/sbin/" || return 1

Modified: testing-x86_64/gconf-merge-schema
===================================================================
--- testing-x86_64/gconf-merge-schema	2009-03-18 21:03:31 UTC (rev 30312)
+++ testing-x86_64/gconf-merge-schema	2009-03-18 21:03:43 UTC (rev 30313)
@@ -1,22 +1,34 @@
-#!/bin/sh
+#!/bin/bash
 if [ ! "$1" -a ! "$2" ]; then
-  echo "Usage: $0 output.schemas file1.schemas [file2.schemas [...]]"
+  echo "Usage: $0 output.schemas [--domain gettextdomain] file1.schemas [file2.schemas [...]]"
   exit 1
 fi
 
 OUTFILE="$1"
+DOMAIN=""
 shift
 
+if [ "$1" = "--domain" ]; then
+  shift
+  DOMAIN=$1
+  shift
+fi
+
 echo '<?xml version="1.0"?>' > "$OUTFILE"
 echo '<gconfschemafile><schemalist>' >> "$OUTFILE"
 
 while [ "$1" ]; do
   if [ -f "$1" ]; then
-    sed -e '/<?xml/d' -e 's|<gconfschemafile>||g' -e 's|</gconfschemafile>||g' \
-        -e 's|<schemalist>||g' -e 's|</schemalist>||g' \
-          "$1" >> "$OUTFILE"
+    sed -e '/<?xml/d' \
+        -e 's|<gconfschemafile>||g' \
+	-e 's|</gconfschemafile>||g' \
+        -e 's|<schemalist>||g' \
+	-e 's|</schemalist>||g' "$1" >> "$OUTFILE"
   fi
   shift
 done
   
 echo '</schemalist></gconfschemafile>' >> "$OUTFILE"
+if [ "$DOMAIN" != "" ]; then
+  sed -ri "s/^([[:space:]]*)(<locale name=\"C\">)/\1<gettext_domain>$DOMAIN<\/gettext_domain>\n\1\2/; /^[[:space:]]*<locale name=\"[^C]/,/^[[:space:]]*<\/locale>[[:space:]]*\$/ d; /^$/d; s/<\/schema>$/&\n/" "$OUTFILE"
+fi

Modified: testing-x86_64/gconf.install
===================================================================
--- testing-x86_64/gconf.install	2009-03-18 21:03:31 UTC (rev 30312)
+++ testing-x86_64/gconf.install	2009-03-18 21:03:43 UTC (rev 30313)
@@ -1,10 +1,8 @@
-# arg 1:  the new package version
 post_install() {
   ldconfig -r .
+  chmod 755 etc/gconf/gconf.xml.system
 }
 
-# arg 1:  the new package version
-# arg 2:  the old package version
 post_upgrade() {
   ldconfig -r .
   if [ `vercmp $2 2.18.0.1-2` -lt 0 ]; then
@@ -19,19 +17,10 @@
     fi
     echo "done."
   fi
+  chmod 755 etc/gconf/gconf.xml.system
     
   PID=`pidof gconfd-2`
   if [ ! -z "${PID}" ]; then
     kill ${PID}
   fi
 }
-
-# arg 1:  the old package version
-pre_remove() {
-  /bin/true
-}
-
-op=$1
-shift
-
-$op $*




More information about the arch-commits mailing list