summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-10-12 00:09:49 +0200
committerAlexander Larsson <alexl@redhat.com>2012-10-12 00:09:49 +0200
commit7dfcc1d1fda1a9bd388ea0823e9b24807782b59e (patch)
tree11292b2757908854bc30b87924c88436cbd428fc
parent79a53dc1b86b35dfbeb377e13f760d6817f7597b (diff)
downloadgvfs-7dfcc1d1fda1a9bd388ea0823e9b24807782b59e.tar.gz
Allow specifying directory and extensions for mount files
This will be used by the test framework to run tests against the in-tree build.
-rw-r--r--daemon/mount.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/daemon/mount.c b/daemon/mount.c
index 6b787ef8..5224a664 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 ();