[gvfs] Allow specifying directory and extensions for mount files



commit 7dfcc1d1fda1a9bd388ea0823e9b24807782b59e
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Oct 12 00:09:49 2012 +0200

    Allow specifying directory and extensions for mount files
    
    This will be used by the test framework to run tests against
    the in-tree build.

 daemon/mount.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/daemon/mount.c b/daemon/mount.c
index 6b787ef..5224a66 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -482,20 +482,29 @@ static void
 read_mountable_config (void)
 {
   GDir *dir;
-  char *mount_dir, *path;
+  char *mount_dir, *mount_extension, *path;
   const char *filename;
   GKeyFile *keyfile;
   char **types;
   VfsMountable *mountable;
   int i;
+
+  mount_extension = g_getenv ("GVFS_MOUNTABLE_EXTENSION");
+  if (mount_extension == NULL || *mount_extension == 0)
+    mount_extension = ".mount";
   
-  mount_dir = MOUNTABLE_DIR;
+  mount_dir = g_getenv ("GVFS_MOUNTABLE_DIR");
+  if (mount_dir == NULL || *mount_dir == 0)
+    mount_dir = MOUNTABLE_DIR;
   dir = g_dir_open (mount_dir, 0, NULL);
 
   if (dir)
     {
       while ((filename = g_dir_read_name (dir)) != NULL)
 	{
+	  if (!g_str_has_suffix (filename, mount_extension))
+	    continue;
+
 	  path = g_build_filename (mount_dir, filename, NULL);
 	  
 	  keyfile = g_key_file_new ();



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