Accepting request 526328 from GNOME:Factory

- Rebase gvfs-nds.patch for gvfs 1.34.0, including identations and
  warnings fixes. (forwarded request 526315 from fcrozat)

OBS-URL: https://build.opensuse.org/request/show/526328
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gvfs?expand=0&rev=136
This commit is contained in:
Dominique Leuenberger 2017-09-15 19:07:40 +00:00 committed by Git OBS Bridge
commit 12bc9cba46
2 changed files with 235 additions and 235 deletions

View File

@ -1,8 +1,9 @@
Index: gvfs-1.9.0/daemon/gvfsbackendnds.c Index: gvfs-1.34.0/daemon/gvfsbackendnds.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gvfs-1.9.0/daemon/gvfsbackendnds.c +++ gvfs-1.34.0/daemon/gvfsbackendnds.c 2017-09-15 10:53:24.564258329 +0200
@@ -0,0 +1,753 @@ @@ -0,0 +1,747 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* GIO - GLib Input, Output and Streaming Library +/* GIO - GLib Input, Output and Streaming Library
+ * + *
+ * Copyright (C) 2006-2007 Red Hat, Inc. + * Copyright (C) 2006-2007 Red Hat, Inc.
@ -33,13 +34,13 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+#include <unistd.h> +#include <unistd.h>
+#include <fcntl.h> +#include <fcntl.h>
+#include <string.h> +#include <string.h>
+#include<stdlib.h> +#include <stdlib.h>
+#include<stdio.h> +#include <stdio.h>
+ +
+#include <glib/gstdio.h> +#include <glib/gstdio.h>
+#include <glib/gi18n.h> +#include <glib/gi18n.h>
+#include <gio/gio.h> +#include <gio/gio.h>
+#include<dlfcn.h> +#include <dlfcn.h>
+#include <sys/utsname.h> +#include <sys/utsname.h>
+ +
+#include "gvfsbackendnds.h" +#include "gvfsbackendnds.h"
@ -68,7 +69,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ char *server; + char *server;
+ char *mounted_server; + char *mounted_server;
+ +
+ GMutex *entries_lock; + GMutex entries_lock;
+ GList *entries; + GList *entries;
+ int entry_errno; + int entry_errno;
+}; +};
@ -147,9 +148,9 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+static void +static void
+browse_entry_free (BrowseEntry *entry) +browse_entry_free (BrowseEntry *entry)
+{ +{
+if(entry->name != NULL) + if(entry->name != NULL)
+ g_free (entry->name); + g_free (entry->name);
+if(entry != NULL) + if(entry != NULL)
+ g_free (entry); + g_free (entry);
+} +}
+ +
@ -161,15 +162,15 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ +
+ backend = G_VFS_BACKEND_NDS (object); + backend = G_VFS_BACKEND_NDS (object);
+ +
+if(backend->mounted_server != NULL) + if(backend->mounted_server != NULL)
+ g_free (backend->mounted_server); + g_free (backend->mounted_server);
+if(backend->server != NULL) + if(backend->server != NULL)
+ g_free (backend->server); + g_free (backend->server);
+ +
+ g_mutex_free (backend->entries_lock); + g_mutex_clear (&backend->entries_lock);
+ +
+ g_list_foreach (backend->entries, (GFunc)browse_entry_free, NULL); + g_list_foreach (backend->entries, (GFunc)browse_entry_free, NULL);
+if(backend->entries != NULL) + if(backend->entries != NULL)
+ g_list_free (backend->entries); + g_list_free (backend->entries);
+ +
+ if (G_OBJECT_CLASS (g_vfs_backend_nds_parent_class)->finalize) + if (G_OBJECT_CLASS (g_vfs_backend_nds_parent_class)->finalize)
@ -179,24 +180,22 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+static void +static void
+g_vfs_backend_nds_init (GVfsBackendNds *backend) +g_vfs_backend_nds_init (GVfsBackendNds *backend)
+{ +{
+ backend->entries_lock = g_mutex_new (); + g_mutex_init(&backend->entries_lock);
+ +
+ if (mount_tracker == NULL) + if (mount_tracker == NULL)
+ mount_tracker = g_mount_tracker_new (NULL); + mount_tracker = g_mount_tracker_new (NULL, FALSE);
+} +}
+ +
+ +
+static void +static void
+update_cache (GVfsBackendNds *backend,const char *filename) +update_cache (GVfsBackendNds *backend,const char *filename)
+{ +{
+ GString *uri;
+ GList *entries; + GList *entries;
+ int entry_errno; + int entry_errno;
+ char *objectname=NULL; + char *objectname=NULL;
+ char *treename=NULL; + char *treename=NULL;
+ GList *objectlist=NULL; + GList *objectlist=NULL;
+ GList *object=NULL; + GList *object=NULL;
+ GList *l;
+ FILE *fptr=NULL; + FILE *fptr=NULL;
+ void *handle=NULL; //handle for dlopen + void *handle=NULL; //handle for dlopen
+ int res; + int res;
@ -212,16 +211,16 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ entries = NULL; + entries = NULL;
+ entry_errno = 0; + entry_errno = 0;
+ +
+if(backend->server != NULL) + if(backend->server != NULL)
+{ + {
+ server_name = g_strdup(backend->server); + server_name = g_strdup(backend->server);
+ if((ptr = strchr(server_name,'%')) != NULL) + if((ptr = strchr(server_name,'%')) != NULL)
+ *ptr = '\0'; + *ptr = '\0';
+ +
+} + }
+ +
+if(backend->server == NULL) //retrieve Tree names + if(backend->server == NULL) //retrieve Tree names
+{ + {
+ treename = (char *)malloc(sizeof(char) * 80); + treename = (char *)malloc(sizeof(char) * 80);
+ system("/opt/novell/ncl/bin/retrieve_trees.pl"); + system("/opt/novell/ncl/bin/retrieve_trees.pl");
+ fptr = fopen("/tmp/ndstrees.txt","r"); + fptr = fopen("/tmp/ndstrees.txt","r");
@ -237,10 +236,10 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ } + }
+ fclose(fptr); + fclose(fptr);
+ free(treename); + free(treename);
+} + }
+ +
+else //retrieve object names + else //retrieve object names
+{ + {
+ uname(&utsbuf); + uname(&utsbuf);
+ if(!strcmp(utsbuf.machine,"x86_64")) + if(!strcmp(utsbuf.machine,"x86_64"))
+ handle = dlopen("/usr/lib64/libinterface.so",RTLD_NOW | RTLD_DEEPBIND); + handle = dlopen("/usr/lib64/libinterface.so",RTLD_NOW | RTLD_DEEPBIND);
@ -269,14 +268,14 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ return; + return;
+ } + }
+ dlclose(handle); + dlclose(handle);
+} + }
+ +
+ +
+ gboolean valid_utf8; + gboolean valid_utf8;
+ BrowseEntry *entry; + BrowseEntry *entry;
+ +
+for(object = objectlist;object != NULL;object = object->next) + for(object = objectlist;object != NULL;object = object->next)
+{ + {
+ entry = g_new (BrowseEntry, 1); + entry = g_new (BrowseEntry, 1);
+ objectname = object->data; + objectname = object->data;
+ entry->name = g_strdup (objectname); + entry->name = g_strdup (objectname);
@ -284,18 +283,18 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ entry->name_normalized = normalize_nds_name_helper (objectname, -1, valid_utf8); + entry->name_normalized = normalize_nds_name_helper (objectname, -1, valid_utf8);
+ +
+ entries = g_list_append (entries, entry); + entries = g_list_append (entries, entry);
+} + }
+ +
+//if(objectlist != NULL) + //if(objectlist != NULL)
+//g_list_free(objectlist); + //g_list_free(objectlist);
+ +
+ out: +out:
+ +
+ if(entry_errno == 0) + if(entry_errno == 0)
+ { + {
+ g_mutex_lock (backend->entries_lock); + g_mutex_lock (&backend->entries_lock);
+ backend->entries = entries; + backend->entries = entries;
+ g_mutex_unlock (backend->entries_lock); + g_mutex_unlock (&backend->entries_lock);
+ } + }
+ backend->entry_errno = entry_errno; + backend->entry_errno = entry_errno;
+ +
@ -309,7 +308,6 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ GList *l; + GList *l;
+ char *end; + char *end;
+ int len; + int len;
+ char *normalized;
+ +
+ while (*filename == '/') + while (*filename == '/')
+ filename++; + filename++;
@ -344,6 +342,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ +
+ if (found == NULL) + if (found == NULL)
+ { + {
+ char *normalized;
+ /* That failed, try normalizing the filename */ + /* That failed, try normalizing the filename */
+ normalized = normalize_nds_name (filename, len); + normalized = normalize_nds_name (filename, len);
+ +
@ -357,7 +356,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ break; + break;
+ } + }
+ } + }
+if(normalized != NULL) + if(normalized != NULL)
+ g_free (normalized); + g_free (normalized);
+ } + }
+ +
@ -390,7 +389,6 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ char *display_name; + char *display_name;
+ char *icon; + char *icon;
+ GMountSpec *browse_mount_spec; + GMountSpec *browse_mount_spec;
+ char *ptr = NULL;
+ +
+ +
+ icon = NULL; + icon = NULL;
@ -428,8 +426,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ gboolean is_automount) + gboolean is_automount)
+{ +{
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend); + GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
+ char *server; + const char *server;
+ char *share;
+ +
+ server = g_mount_spec_get (mount_spec, "host"); + server = g_mount_spec_get (mount_spec, "host");
+ if (server) + if (server)
@ -452,18 +449,16 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ const char *filename, + const char *filename,
+ GMountSource *mount_source) + GMountSource *mount_source)
+{ +{
+ BrowseEntry *entry;
+ GError *error = NULL;
+ GMountSpec *mount_spec; + GMountSpec *mount_spec;
+ +
+ g_mutex_lock (backend->entries_lock); + g_mutex_lock (&backend->entries_lock);
+ +
+backend->server = g_strdup(filename); + backend->server = g_strdup(filename);
+ +
+ mount_spec = get_mount_spec_for_share (backend->server, filename); + mount_spec = get_mount_spec_for_share (backend->server, filename);
+ g_vfs_job_mount_mountable_set_target (job, mount_spec, "/", TRUE); + g_vfs_job_mount_mountable_set_target (job, mount_spec, "/", TRUE);
+ g_mount_spec_unref (mount_spec); + g_mount_spec_unref (mount_spec);
+ g_mutex_unlock (backend->entries_lock); + g_mutex_unlock (&backend->entries_lock);
+ +
+ g_vfs_job_succeeded (G_VFS_JOB (job)); + g_vfs_job_succeeded (G_VFS_JOB (job));
+} +}
@ -477,7 +472,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+{ +{
+ GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend); + GVfsBackendNds *op_backend = G_VFS_BACKEND_NDS (backend);
+ +
+update_cache (op_backend,filename); + update_cache (op_backend,filename);
+ +
+ run_mount_mountable (op_backend, + run_mount_mountable (op_backend,
+ job, + job,
@ -563,7 +558,6 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+static void +static void
+get_file_info_from_entry (GVfsBackendNds *backend, BrowseEntry *entry, GFileInfo *info) +get_file_info_from_entry (GVfsBackendNds *backend, BrowseEntry *entry, GFileInfo *info)
+{ +{
+ GMountSpec *mount_spec;
+ GString *uri; + GString *uri;
+ GIcon *icon; + GIcon *icon;
+ +
@ -583,8 +577,6 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ g_object_unref (icon); + g_object_unref (icon);
+ } + }
+ +
+ mount_spec = NULL;
+
+ g_file_info_set_file_type (info, G_FILE_TYPE_SHORTCUT); + g_file_info_set_file_type (info, G_FILE_TYPE_SHORTCUT);
+ +
+ uri = g_string_new ("nds://"); + uri = g_string_new ("nds://");
@ -606,14 +598,14 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+{ +{
+ BrowseEntry *entry; + BrowseEntry *entry;
+ +
+ g_mutex_lock (backend->entries_lock); + g_mutex_lock (&backend->entries_lock);
+ +
+ entry = find_entry_unlocked (backend, filename); + entry = find_entry_unlocked (backend, filename);
+ +
+ if (entry) + if (entry)
+ get_file_info_from_entry (backend, entry, info); + get_file_info_from_entry (backend, entry, info);
+ +
+ g_mutex_unlock (backend->entries_lock); + g_mutex_unlock (&backend->entries_lock);
+ +
+ if (entry) + if (entry)
+ g_vfs_job_succeeded (G_VFS_JOB (job)); + g_vfs_job_succeeded (G_VFS_JOB (job));
@ -684,7 +676,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ g_vfs_job_succeeded (G_VFS_JOB (job)); + g_vfs_job_succeeded (G_VFS_JOB (job));
+ +
+ files = NULL; + files = NULL;
+ g_mutex_lock (backend->entries_lock); + g_mutex_lock (&backend->entries_lock);
+ for (l = backend->entries; l != NULL; l = l->next) + for (l = backend->entries; l != NULL; l = l->next)
+ { + {
+ BrowseEntry *entry = l->data; + BrowseEntry *entry = l->data;
@ -694,7 +686,7 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ +
+ files = g_list_prepend (files, info); + files = g_list_prepend (files, info);
+ } + }
+ g_mutex_unlock (backend->entries_lock); + g_mutex_unlock (&backend->entries_lock);
+ +
+ files = g_list_reverse (files); + files = g_list_reverse (files);
+ +
@ -749,6 +741,8 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+ backend_class->try_query_info = try_query_info; + backend_class->try_query_info = try_query_info;
+ backend_class->enumerate = do_enumerate; + backend_class->enumerate = do_enumerate;
+ backend_class->try_enumerate = try_enumerate; + backend_class->try_enumerate = try_enumerate;
+ backend_class->try_mount_mountable = try_mount_mountable;
+ backend_class->mount_mountable = do_mount_mountable;
+} +}
+ +
+void +void
@ -756,10 +750,10 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.c
+{ +{
+ g_set_application_name (_("Displaying Embedded Objects")); + g_set_application_name (_("Displaying Embedded Objects"));
+} +}
Index: gvfs-1.9.0/daemon/gvfsbackendnds.h Index: gvfs-1.34.0/daemon/gvfsbackendnds.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gvfs-1.9.0/daemon/gvfsbackendnds.h +++ gvfs-1.34.0/daemon/gvfsbackendnds.h 2017-09-15 10:53:56.159989373 +0200
@@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
+/* GIO - GLib Input, Output and Streaming Library +/* GIO - GLib Input, Output and Streaming Library
+ * + *
@ -814,11 +808,11 @@ Index: gvfs-1.9.0/daemon/gvfsbackendnds.h
+G_END_DECLS +G_END_DECLS
+ +
+#endif /* __G_VFS_BACKEND_NDS_H__ */ +#endif /* __G_VFS_BACKEND_NDS_H__ */
Index: gvfs-1.9.0/daemon/Makefile.am Index: gvfs-1.34.0/daemon/Makefile.am
=================================================================== ===================================================================
--- gvfs-1.9.0.orig/daemon/Makefile.am --- gvfs-1.34.0.orig/daemon/Makefile.am 2017-09-15 10:15:10.715090208 +0200
+++ gvfs-1.9.0/daemon/Makefile.am +++ gvfs-1.34.0/daemon/Makefile.am 2017-09-15 10:15:46.554940823 +0200
@@ -143,6 +143,10 @@ mount_in_files += nvvfs.mount.in @@ -144,6 +144,10 @@
mount_DATA += nvvfs.mount mount_DATA += nvvfs.mount
libexec_PROGRAMS += gvfsd-nvvfs libexec_PROGRAMS += gvfsd-nvvfs
@ -829,7 +823,7 @@ Index: gvfs-1.9.0/daemon/Makefile.am
EXTRA_DIST = \ EXTRA_DIST = \
$(service_in_files) \ $(service_in_files) \
$(systemd_user_in_files) \ $(systemd_user_in_files) \
@@ -525,6 +529,19 @@ gvfsd_http_CPPFLAGS = \ @@ -528,6 +532,19 @@
gvfsd_http_LDADD = $(libraries) $(HTTP_LIBS) gvfsd_http_LDADD = $(libraries) $(HTTP_LIBS)
@ -849,10 +843,10 @@ Index: gvfs-1.9.0/daemon/Makefile.am
gvfsd_nvvfs_SOURCES = \ gvfsd_nvvfs_SOURCES = \
gvfsbackendnvvfs.c gvfsbackendnvvfs.h \ gvfsbackendnvvfs.c gvfsbackendnvvfs.h \
daemon-main.c daemon-main.h \ daemon-main.c daemon-main.h \
Index: gvfs-1.9.0/daemon/nds.mount.in Index: gvfs-1.34.0/daemon/nds.mount.in
=================================================================== ===================================================================
--- /dev/null --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gvfs-1.9.0/daemon/nds.mount.in +++ gvfs-1.34.0/daemon/nds.mount.in 2017-09-15 10:15:46.554940823 +0200
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
+[Mount] +[Mount]
+Type=nds +Type=nds

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 15 09:01:05 UTC 2017 - fcrozat@suse.com
- Rebase gvfs-nds.patch for gvfs 1.34.0, including identations and
warnings fixes.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Sep 11 16:31:55 UTC 2017 - dimstar@opensuse.org Mon Sep 11 16:31:55 UTC 2017 - dimstar@opensuse.org