r12991 - in /desktop/unstable/gnome-vfs2/debian: changelog patches/24_gnome_vfs_home_dir.patch patches/24_home_dir_fakeroot.patch patches/series

joss at users.alioth.debian.org joss at users.alioth.debian.org
Sat Oct 6 14:55:36 UTC 2007


Author: joss
Date: Sat Oct  6 14:55:36 2007
New Revision: 12991

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=12991
Log:
* 24_home_dir_fakeroot.patch: replaces 24_gnome_vfs_home_dir.patch. 
  Add a new function, _gnome_vfs_get_home_dir, and use it only where 
  appropriate, i.e. when dot files need to be written.

Added:
    desktop/unstable/gnome-vfs2/debian/patches/24_home_dir_fakeroot.patch
Removed:
    desktop/unstable/gnome-vfs2/debian/patches/24_gnome_vfs_home_dir.patch
Modified:
    desktop/unstable/gnome-vfs2/debian/changelog
    desktop/unstable/gnome-vfs2/debian/patches/series

Modified: desktop/unstable/gnome-vfs2/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-vfs2/debian/changelog?rev=12991&op=diff
==============================================================================
--- desktop/unstable/gnome-vfs2/debian/changelog (original)
+++ desktop/unstable/gnome-vfs2/debian/changelog Sat Oct  6 14:55:36 2007
@@ -1,4 +1,4 @@
-gnome-vfs (1:2.20.0-2) UNRELEASED; urgency=low
+gnome-vfs (1:2.20.0-2) unstable; urgency=low
 
   [ Josselin Mouette ]
   * Remove orbit hack, it's useless now.
@@ -12,7 +12,12 @@
   * debian/watch:
     + Fix location for newer versions.
 
- -- Sebastian Dröge <slomo at debian.org>  Tue, 02 Oct 2007 11:05:58 +0200
+  [ Josselin Mouette ]
+  * 24_home_dir_fakeroot.patch: replaces 24_gnome_vfs_home_dir.patch. 
+    Add a new function, _gnome_vfs_get_home_dir, and use it only where 
+    appropriate, i.e. when dot files need to be written.
+
+ -- Josselin Mouette <joss at debian.org>  Sat, 06 Oct 2007 12:15:14 +0200
 
 gnome-vfs2 (1:2.20.0-1) unstable; urgency=low
 

Added: desktop/unstable/gnome-vfs2/debian/patches/24_home_dir_fakeroot.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-vfs2/debian/patches/24_home_dir_fakeroot.patch?rev=12991&op=file
==============================================================================
--- desktop/unstable/gnome-vfs2/debian/patches/24_home_dir_fakeroot.patch (added)
+++ desktop/unstable/gnome-vfs2/debian/patches/24_home_dir_fakeroot.patch Sat Oct  6 14:55:36 2007
@@ -1,0 +1,160 @@
+Index: gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-application-registry.c
+===================================================================
+--- gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-application-registry.c	2007-10-06 12:01:42.746725988 +0200
++++ gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-application-registry.c	2007-10-06 12:02:12.668431129 +0200
+@@ -965,7 +965,7 @@
+ 						       NULL);
+ 	gnome_registry_dir.system_dir = TRUE;
+ 	
+-	user_registry_dir.dirname = g_build_filename (g_get_home_dir(),
++	user_registry_dir.dirname = g_build_filename (_gnome_vfs_get_home_dir(),
+ 						      ".gnome",
+ 						      "application-info",
+ 						      NULL);
+Index: gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-init.c
+===================================================================
+--- gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-init.c	2007-10-06 11:25:05.997540386 +0200
++++ gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-init.c	2007-10-06 12:01:27.329847430 +0200
+@@ -59,29 +59,6 @@
+ 
+ static GPrivate * private_is_primary_thread;
+ 
+-static gboolean
+-ensure_dot_gnome_exists (void)
+-{
+-	gboolean retval = TRUE;
+-	gchar *dirname;
+-
+-	dirname = g_build_filename (g_get_home_dir (), ".gnome2", NULL);
+-
+-	if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) {
+-		if (g_mkdir (dirname, S_IRWXU) != 0) {
+-			g_warning ("Unable to create ~/.gnome2 directory: %s",
+-				   g_strerror (errno));
+-			retval = FALSE;
+-		}
+-	} else if (!g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
+-		g_warning ("Error: ~/.gnome2 must be a directory.");
+-		retval = FALSE;
+-	}
+-
+-	g_free (dirname);
+-	return retval;
+-}
+-
+ static void
+ gnome_vfs_thread_init (void)
+ {
+@@ -112,7 +89,8 @@
+ 	char *bogus_argv[2] = { "dummy", NULL };
+ 	*/
+ 	
+-	if (!ensure_dot_gnome_exists ()) {
++	/* The first call also checks that ~/.gnome2 is writable. */
++	if (!_gnome_vfs_get_home_dir ()) {
+ 		return FALSE;
+ 	}
+ 
+Index: gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-private-utils.c
+===================================================================
+--- gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-private-utils.c	2007-10-06 11:25:16.930163401 +0200
++++ gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-private-utils.c	2007-10-06 12:01:15.081149417 +0200
+@@ -1086,3 +1086,54 @@
+ }
+ #endif
+ 
++static gboolean
++ensure_dot_gnome_exists (home_dir)
++{
++	gboolean retval = TRUE;
++	gchar *dirname;
++
++	dirname = g_build_filename (home_dir, ".gnome2", NULL);
++
++	if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) {
++		if (g_mkdir (dirname, S_IRWXU) != 0) {
++			g_warning ("Unable to create ~/.gnome2 directory: %s",
++				   g_strerror (errno));
++			retval = FALSE;
++		}
++	} else if (!g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
++		g_warning ("Error: ~/.gnome2 must be a directory.");
++		retval = FALSE;
++	}
++
++	g_free (dirname);
++	return retval;
++}
++
++/**
++ * _gnome_vfs_get_home_dir:
++ *
++ * If ~/.gnome2 is writable, return the home directory
++ * Otherwise, return the contents of the HOME environment variable
++ *
++ * Return value: home directory if successful, NULL otherwise.
++ * Do not free the value returned.
++ */
++const gchar *
++_gnome_vfs_get_home_dir (void)
++{
++	static gchar *home = NULL;
++
++	if (home == NULL) {
++		gchar *tmp = g_get_home_dir ();
++		if (ensure_dot_gnome_exists (tmp)) {
++			home = g_strdup (tmp);
++		} else {
++			gchar *tmp2 = g_getenv ("HOME");
++			if (!g_str_equal (tmp, tmp2) && ensure_dot_gnome_exists (tmp2)) {
++				home = g_strdup (tmp2);
++			}
++		}
++	}
++
++	return home;
++}
+Index: gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-private-utils.h
+===================================================================
+--- gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-private-utils.h	2007-10-06 11:25:16.958164997 +0200
++++ gnome-vfs-2.20.0/libgnomevfs/gnome-vfs-private-utils.h	2007-10-06 11:58:20.991228597 +0200
+@@ -124,6 +124,8 @@
+ 
+ #endif
+ 
++const gchar   *_gnome_vfs_get_home_dir                    (void);
++
+ G_END_DECLS
+ 
+ #endif /* _GNOME_VFS_PRIVATE_UTILS_H */
+Index: gnome-vfs-2.20.0/modules/file-method.c
+===================================================================
+--- gnome-vfs-2.20.0.orig/modules/file-method.c	2007-10-06 12:06:41.527752548 +0200
++++ gnome-vfs-2.20.0/modules/file-method.c	2007-10-06 12:11:08.982993954 +0200
+@@ -1536,7 +1536,7 @@
+ 	GList *p;
+ 	char *buffer, *escaped_path, *escaped_mount_point;
+ 
+-	cache_file_parent = append_to_path (g_get_home_dir (), TRASH_ENTRY_CACHE_PARENT);
++	cache_file_parent = append_to_path (_gnome_vfs_get_home_dir (), TRASH_ENTRY_CACHE_PARENT);
+ 	cache_file_path = append_to_path (cache_file_parent, TRASH_ENTRY_CACHE_NAME);
+ 
+ 	if (mkdir_recursive (cache_file_parent, 0777) != 0) {
+@@ -1675,7 +1675,7 @@
+ 	cached_trash_directories = NULL;
+ 
+ 	/* read in the entries from disk */
+-	cache_file_path = g_build_filename (g_get_home_dir (),
++	cache_file_path = g_build_filename (_gnome_vfs_get_home_dir (),
+ 					    TRASH_ENTRY_CACHE_PARENT,
+ 					    TRASH_ENTRY_CACHE_NAME,
+ 					    NULL);
+@@ -1947,7 +1947,7 @@
+ 		return GNOME_VFS_ERROR_INVALID_URI;
+ 
+ 	/* We will need the URI and the stat structure for the home directory. */
+-	home_directory = g_get_home_dir ();
++	home_directory = _gnome_vfs_get_home_dir ();
+ 
+ 	if (gnome_vfs_context_check_cancellation (context)) {
+ 		g_free (full_name_near);

Modified: desktop/unstable/gnome-vfs2/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-vfs2/debian/patches/series?rev=12991&op=diff
==============================================================================
--- desktop/unstable/gnome-vfs2/debian/patches/series (original)
+++ desktop/unstable/gnome-vfs2/debian/patches/series Sat Oct  6 14:55:36 2007
@@ -16,5 +16,6 @@
 20_dont_register_keys_for_gaim.patch
 22_ignore_inaccessible_volumes.patch
 23_improve_volume_labels.patch
+24_home_dir_fakeroot.patch
 30_nfs4.patch
 99_ltmain_as-needed.patch




More information about the pkg-gnome-commits mailing list