From d48f19b46296e190b261e86fca33852be3110d27 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 17 Nov 2013 10:00:22 +0000 Subject: [PATCH] Fix for https://bugzilla.redhat.com/show_bug.cgi?id=984913 gvfs-gphoto2 fails when copying files from the camera using caja or nautilus --- glib-g-file-copy-rhbz984913.patch | 54 +++++++++++++++++++++++++++++++ glib2.spec | 10 +++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 glib-g-file-copy-rhbz984913.patch diff --git a/glib-g-file-copy-rhbz984913.patch b/glib-g-file-copy-rhbz984913.patch new file mode 100644 index 0000000..104dd30 --- /dev/null +++ b/glib-g-file-copy-rhbz984913.patch @@ -0,0 +1,54 @@ +From be2656f13952dd22d348ff5e3f43240700cdef5a Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Wed, 16 Oct 2013 14:10:22 +0000 +Subject: g_file_copy: Fall back to pathname queryinfo to help gvfs backends + +It's not difficult to do; not all backends implement it, and for some +it may be difficult to implement query_info_on_read(), so let's just +do both. + +https://bugzilla.gnome.org/show_bug.cgi?id=706254 +--- +diff --git a/gio/gfile.c b/gio/gfile.c +index afaee21..bf936ec 100644 +--- a/gio/gfile.c ++++ b/gio/gfile.c +@@ -3112,6 +3112,8 @@ file_copy_fallback (GFile *source, + + if (attrs_to_read != NULL) + { ++ GError *tmp_error = NULL; ++ + /* Ok, ditch the previous lightweight info (on Unix we just + * called lstat()); at this point we gather all the information + * we need about the source from the opened file descriptor. +@@ -3119,7 +3121,26 @@ file_copy_fallback (GFile *source, + g_object_unref (info); + + info = g_file_input_stream_query_info (file_in, attrs_to_read, +- cancellable, error); ++ cancellable, &tmp_error); ++ if (!info) ++ { ++ /* Not all gvfs backends implement query_info_on_read(), we ++ * can just fall back to the pathname again. ++ * https://bugzilla.gnome.org/706254 ++ */ ++ if (g_error_matches (tmp_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED)) ++ { ++ g_clear_error (&tmp_error); ++ info = g_file_query_info (source, attrs_to_read, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, ++ cancellable, error); ++ } ++ else ++ { ++ g_free (attrs_to_read); ++ g_propagate_error (error, tmp_error); ++ goto out; ++ } ++ } + g_free (attrs_to_read); + if (!info) + goto out; +-- +cgit v0.9.2 diff --git a/glib2.spec b/glib2.spec index 7d1cdb4..29d043c 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,7 +1,7 @@ Summary: A library of handy utility functions Name: glib2 Version: 2.36.3 -Release: 3%{?dist} +Release: 4%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -9,6 +9,9 @@ URL: http://www.gtk.org Source: http://download.gnome.org/sources/glib/2.36/glib-%{version}.tar.xz Patch0: 0001-Revert-g_file_set_contents-don-t-fsync-on-ext3-4.patch Patch1: 0001-gnetworkmonitornetlink-handle-default-route-via-devi.patch +# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=984913 +# gvfs-gphoto2 fails when copying files from the camera using caja or nautilus +Patch2: glib-g-file-copy-rhbz984913.patch BuildRequires: pkgconfig BuildRequires: gettext @@ -68,6 +71,7 @@ The glib2-fam package contains the FAM (File Alteration Monitor) module for GIO. %setup -q -n glib-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 autoreconf -i -f @@ -190,6 +194,10 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules %{_libdir}/gio/modules/libgiofam.so %changelog +* Sun Nov 17 2013 Richard W.M. Jones - 2.36.3-4 +- Fix for https://bugzilla.redhat.com/show_bug.cgi?id=984913 + gvfs-gphoto2 fails when copying files from the camera using caja or nautilus + * Thu Aug 1 2013 David Woodhouse - 2.36.3-3 - Backport patch from upstream for online detection failure (#983426)