pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/GConf2 Implement a framework to handle .entries ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/11f705911a4c
branches:  trunk
changeset: 465354:11f705911a4c
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Sun Dec 28 14:24:49 2003 +0000

description:
Implement a framework to handle .entries files.  If a package installs
one or more .entries files, it can set GCONF2_ENTRIES to the names of those
files and they will get (un)registered at (de)installation time.

Installation is handled after .schemas are installed, and uninstallation
before .schemas are deinstalled.

To achieve this, we need to implement an --unload flag in gconftool-2 to
allow clean removal of .entries from the database.  This will be fed back
to authors.

Bump PKGREVISION to 1.

diffstat:

 devel/GConf2/Makefile.common      |    3 +-
 devel/GConf2/distinfo             |    3 +-
 devel/GConf2/files/deinstall.tmpl |    7 +-
 devel/GConf2/files/install.tmpl   |    7 +-
 devel/GConf2/patches/patch-ae     |  116 ++++++++++++++++++++++++++++++++++++++
 devel/GConf2/schemas.mk           |    6 +-
 6 files changed, 136 insertions(+), 6 deletions(-)

diffs (220 lines):

diff -r 3cffae0a0de0 -r 11f705911a4c devel/GConf2/Makefile.common
--- a/devel/GConf2/Makefile.common      Sun Dec 28 12:47:09 2003 +0000
+++ b/devel/GConf2/Makefile.common      Sun Dec 28 14:24:49 2003 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile.common,v 1.8 2003/12/14 19:44:38 jmmv Exp $
+# $NetBSD: Makefile.common,v 1.9 2003/12/28 14:24:49 jmmv Exp $
 #
 
 DISTNAME=              GConf-2.4.0.1
+PKGREVISION=           1
 CATEGORIES=            devel gnome
 MASTER_SITES=          ${MASTER_SITE_GNOME:=sources/GConf/2.4/}
 EXTRACT_SUFX=          .tar.bz2
diff -r 3cffae0a0de0 -r 11f705911a4c devel/GConf2/distinfo
--- a/devel/GConf2/distinfo     Sun Dec 28 12:47:09 2003 +0000
+++ b/devel/GConf2/distinfo     Sun Dec 28 14:24:49 2003 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2003/12/14 19:44:38 jmmv Exp $
+$NetBSD: distinfo,v 1.8 2003/12/28 14:24:49 jmmv Exp $
 
 SHA1 (GConf-2.4.0.1.tar.bz2) = 190ed06d34699976a9a425e9e14d4ccb26220ba8
 Size (GConf-2.4.0.1.tar.bz2) = 1288876 bytes
@@ -6,3 +6,4 @@
 SHA1 (patch-ab) = eb9ffa0ec87fe21b0f754aef019221d619b37b11
 SHA1 (patch-ac) = de42b523072ff5eac020525c2ccb4ce93ed792c6
 SHA1 (patch-ad) = 50b0d919768b179d0209c49aee25a7c64ca5b497
+SHA1 (patch-ae) = 292895b5a71e9b21963d258c6eeed976c9b01d30
diff -r 3cffae0a0de0 -r 11f705911a4c devel/GConf2/files/deinstall.tmpl
--- a/devel/GConf2/files/deinstall.tmpl Sun Dec 28 12:47:09 2003 +0000
+++ b/devel/GConf2/files/deinstall.tmpl Sun Dec 28 14:24:49 2003 +0000
@@ -1,15 +1,20 @@
-# $NetBSD: deinstall.tmpl,v 1.4 2003/12/14 19:44:38 jmmv Exp $
+# $NetBSD: deinstall.tmpl,v 1.5 2003/12/28 14:24:49 jmmv Exp $
 #
 # Unregister GConf2 schema files from GConf2's database at install time.
 #
 
 GCONFTOOL2="@GCONFTOOL2@"
+GCONF2_ENTRIES="@GCONF2_ENTRIES@"
 GCONF2_SCHEMAS="@GCONF2_SCHEMAS@"
 GCONF2_SCHEMAS_DIR="@GCONF2_SCHEMAS_DIR@"
 GCONF2_CONFIG_SOURCE="@GCONF2_CONFIG_SOURCE@"
 
 case ${STAGE} in
 DEINSTALL)
+       for f in ${GCONF2_ENTRIES}; do
+               ${GCONFTOOL2} --config-source=${GCONF2_CONFIG_SOURCE} \
+                       --direct --unload ${GCONF2_SCHEMAS_DIR}/$f >/dev/null
+       done
        for f in ${GCONF2_SCHEMAS}; do
                GCONF_CONFIG_SOURCE="${GCONF2_CONFIG_SOURCE}" \
                        ${GCONFTOOL2} --makefile-uninstall-rule \
diff -r 3cffae0a0de0 -r 11f705911a4c devel/GConf2/files/install.tmpl
--- a/devel/GConf2/files/install.tmpl   Sun Dec 28 12:47:09 2003 +0000
+++ b/devel/GConf2/files/install.tmpl   Sun Dec 28 14:24:49 2003 +0000
@@ -1,9 +1,10 @@
-# $NetBSD: install.tmpl,v 1.3 2003/06/20 10:49:18 jmmv Exp $
+# $NetBSD: install.tmpl,v 1.4 2003/12/28 14:24:49 jmmv Exp $
 #
 # Register GConf2 schema files into GConf2's database at install time.
 #
 
 GCONFTOOL2="@GCONFTOOL2@"
+GCONF2_ENTRIES="@GCONF2_ENTRIES@"
 GCONF2_SCHEMAS="@GCONF2_SCHEMAS@"
 GCONF2_SCHEMAS_DIR="@GCONF2_SCHEMAS_DIR@"
 GCONF2_CONFIG_SOURCE="@GCONF2_CONFIG_SOURCE@"
@@ -15,6 +16,10 @@
                        ${GCONFTOOL2} --makefile-install-rule \
                        ${GCONF2_SCHEMAS_DIR}/$f >/dev/null
        done
+       for f in ${GCONF2_ENTRIES}; do
+               ${GCONFTOOL2} --config-source=${GCONF2_CONFIG_SOURCE} \
+                       --direct --load ${GCONF2_SCHEMAS_DIR}/$f >/dev/null
+       done
        ;;
 *)
        ;;
diff -r 3cffae0a0de0 -r 11f705911a4c devel/GConf2/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/GConf2/patches/patch-ae     Sun Dec 28 14:24:49 2003 +0000
@@ -0,0 +1,116 @@
+$NetBSD: patch-ae,v 1.3 2003/12/28 14:24:49 jmmv Exp $
+
+--- gconf/gconftool.c.orig     2003-08-18 20:13:20.000000000 +0200
++++ gconf/gconftool.c
+@@ -59,6 +59,7 @@ static char* long_desc = NULL;
+ static char* owner = NULL;
+ static char* schema_file = NULL;
+ static char* entry_file = NULL;
++static char* unload_entry_file = NULL;
+ static const char* config_source = NULL;
+ static int use_local_source = FALSE;
+ static int makefile_install_mode = FALSE;
+@@ -167,6 +168,15 @@ struct poptOption options[] = {
+     NULL
+   },
+   {
++    "unload",
++    '\0',
++    POPT_ARG_STRING,
++    &unload_entry_file,
++    0,
++    N_("Unload a set of values described in an XML file."),
++    NULL
++  },
++  {
+     "recursive-list",
+     'R',
+     POPT_ARG_NONE,
+@@ -838,6 +848,18 @@ main (int argc, char** argv)
+       return retval;
+     }
+   
++  if (unload_entry_file != NULL)
++    {
++      const gchar** args = poptGetArgs(ctx);
++      gint retval;
++
++      retval = do_load_file(conf, LOAD_ENTRY_FILE, unload_entry_file, args);
++
++      gconf_engine_unref(conf);
++
++      return retval;
++    }
++
+   if (spawn_gconfd)
+     {
+       do_spawn_daemon(conf);
+@@ -2760,15 +2782,14 @@ set_values(GConfEngine* conf, const gcha
+   else
+     full_key = g_strdup(key);
+ 
+-  if (schema_key)
++  full_schema_key = NULL;
++  if (unload_entry_file == NULL && schema_key)
+     {
+       if (base_dir && *schema_key != '/')
+         full_schema_key = gconf_concat_dir_and_key(base_dir, schema_key);
+       else
+         full_schema_key = g_strdup(schema_key);
+     }
+-  else
+-    full_schema_key = NULL;
+ 
+   tmp = values;
+   while (tmp)
+@@ -2776,21 +2797,21 @@ set_values(GConfEngine* conf, const gcha
+       GConfValue* value = tmp->data;
+       GError* error;
+ 
+-      if (full_schema_key)
++      error = NULL;
++      if (!gconf_engine_associate_schema(conf, full_key, full_schema_key,  &error))
+         {
+-          error = NULL;
+-          if (!gconf_engine_associate_schema(conf, full_key, full_schema_key,  &error))
+-            {
+-              g_assert(error != NULL);
+-          
+-              g_printerr (_("WARNING: failed to associate schema `%s' with key `%s': %s\n"),
+-                        full_schema_key, full_key, error->message);
+-              g_error_free(error);
+-            }
++          g_assert(error != NULL);
++
++          g_printerr (_("WARNING: failed to associate schema `%s' with key `%s': %s\n"),
++                      full_schema_key, full_key, error->message);
++          g_error_free(error);
+         }
+ 
+       error = NULL;
+-      gconf_engine_set(conf, full_key, value, &error);
++      if (unload_entry_file != NULL)
++        gconf_engine_unset(conf, full_key, &error);
++      else
++        gconf_engine_set(conf, full_key, value, &error);
+       if (error != NULL)
+         {
+           g_printerr (_("Error setting value: %s\n"), error->message);
+@@ -3307,7 +3328,7 @@ process_key_list(GConfEngine* conf, cons
+   GSList* tmp;
+   GError* error = NULL;
+ 
+-  if (makefile_uninstall_mode)
++  if (makefile_uninstall_mode || unload_entry_file != NULL)
+     {
+       schema_name = NULL;
+     }
+@@ -3504,7 +3525,7 @@ process_schema(GConfEngine* conf, xmlNod
+ 
+       hash_foreach_info.conf = conf;
+       hash_foreach_info.key = schema_key;
+-      if (makefile_uninstall_mode)
++      if (makefile_uninstall_mode || unload_entry_file != NULL)
+         g_hash_table_foreach(schemas_hash, hash_uninstall_foreach, &hash_foreach_info);
+       else 
+         g_hash_table_foreach(schemas_hash, hash_install_foreach, &hash_foreach_info);
diff -r 3cffae0a0de0 -r 11f705911a4c devel/GConf2/schemas.mk
--- a/devel/GConf2/schemas.mk   Sun Dec 28 12:47:09 2003 +0000
+++ b/devel/GConf2/schemas.mk   Sun Dec 28 14:24:49 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: schemas.mk,v 1.3 2003/04/21 00:12:33 rh Exp $
+# $NetBSD: schemas.mk,v 1.4 2003/12/28 14:24:49 jmmv Exp $
 #
 # This Makefile fragment is intended to be included by packages that install
 # GConf2 schema files.  It takes care of registering them in the GConf2
@@ -37,9 +37,11 @@
 CONFIGURE_ARGS+=       --with-gconf-schema-file-dir=${GCONF2_SCHEMAS_DIR}
 .endif
 
-.if defined(GCONF2_SCHEMAS) && !empty(GCONF2_SCHEMAS)
+.if (defined(GCONF2_SCHEMAS) && !empty(GCONF2_SCHEMAS)) || \
+    (defined(GCONF2_ENTRIES) && !empty(GCONF2_ENTRIES))
 FILES_SUBST+=          GCONFTOOL2="${GCONFTOOL2}"
 FILES_SUBST+=          GCONF2_CONFIG_SOURCE="${GCONF2_CONFIG_SOURCE}"
+FILES_SUBST+=          GCONF2_ENTRIES="${GCONF2_ENTRIES}"
 FILES_SUBST+=          GCONF2_SCHEMAS="${GCONF2_SCHEMAS}"
 FILES_SUBST+=          GCONF2_SCHEMAS_DIR="${GCONF2_SCHEMAS_DIR}"
 INSTALL_EXTRA_TMPL+=   ${.CURDIR}/../../devel/GConf2/files/install.tmpl



Home | Main Index | Thread Index | Old Index