gvfs claming that http is not supported.

Neil Williams codehelp at debian.org
Sat Mar 22 01:15:09 UTC 2008


I'm trying to port deb-gview[0] to GIO and GVfs.

Local files all work fine (in deb-gview CVS [1]) but I cannot get any
form of http support to operate.

I've copied some code from the source for nautilus in experimental to
make sure I'm writing the tests right but all I get is:

$ ./src/deb-gview
http://ftp.debian.org/debian/pool/main/g/gpe-tetris/gpe-tetris_0.6.4-1_i386.deb
** Message: Using scheme:http

** (deb-gview:31002): WARNING **: The specified location is not
supported

(deb-gview:31002): GLib-GIO-CRITICAL **:
g_file_info_set_attribute_boolean: assertion `G_IS_FILE_INFO (info)'
failed

** (deb-gview:31002): WARNING **: The specified location is not
supported

(deb-gview:31002): GLib-GIO-CRITICAL **:
g_file_info_get_attribute_boolean: assertion `G_IS_FILE_INFO (info)'
failed
** Message: failed to set mountable

** (deb-gview:31002): WARNING **:
file-read:http://ftp.debian.org/debian/pool/main/g/gpe-tetris/gpe-tetris_0.6.4-1_i386.deb:The specified location is not supported

The current code in deb-gview CVS (which should work with debcheckout)
simply shows the last error - the rest come from some test code that I
copied in from nautilus and extended a bit with some extra debug code:

			/* try to get the remote file */
			GFileInputStream * is;
			gpointer data;
//			GError *error;
			guint i;
			const gchar * const * supported_uri_schemes;

			g_io_modules_load_all_in_directory ("/usr/lib/gvfs/");
			g_message ("Using scheme:%s", g_file_get_uri_scheme(gfile));
			supported_uri_schemes = g_vfs_get_supported_uri_schemes (vfs);
			for (i = 0; supported_uri_schemes != NULL && supported_uri_schemes[i] != NULL; i++)
			{
				gchar * y = g_strdup(supported_uri_schemes[i]);
				g_message ("scheme=%s", y);
				g_free (y);
			}
			ginfo = g_file_query_info (gfile, G_FILE_ATTRIBUTE_STANDARD_SIZE,
				G_FILE_QUERY_INFO_NONE, NULL, &result);
			if (result)
				g_warning (result->message);
			g_clear_error (&result);
			g_file_info_set_attribute_boolean (ginfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT, TRUE);
			ginfo = g_file_query_info (gfile, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT,
				G_FILE_QUERY_INFO_NONE, NULL, &result);
			if (result)
				g_warning (result->message);
			g_clear_error (&result);
			if (TRUE == g_file_info_get_attribute_boolean (ginfo, 
					G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT))
				g_message ("should be mountable");
			else
				g_message ("failed to set mountable");
			data = g_strnfill (1024, ' ');
			is = g_file_read (gfile, NULL, &result);
			if (result)
			{
				gchar * t;
				t = g_file_get_uri (gfile);
				g_warning ("file-read:%s:%s", t, result->message);
				g_free (t);
				g_clear_error (&result);
				return FALSE;
			}
			g_input_stream_read (G_INPUT_STREAM(is), data, 1024, NULL, &result);
			if (result)
			{
				g_warning ("stream-read:%s", result->message);
				g_clear_error (&result);
			}
			g_object_unref (gfile);
			return FALSE;
		}

The GIOModule code is just a test, as is the GFileInfo method to try and
force the mountable setting for the relevant GFile.

The problem is that this is quite hard for me to test - nautilus needs
another package from experimental before it can build, I use amd64 which
hasn't built the experimental nautilus yet, nautilus itself is probably
not something I want to replace on this box but it's the only place I've
found test code that is supposed to work.

$ dpkg -l 'gvfs*'
ii  gvfs           0.2.1-1        userspace virtual filesystem - server
ii  gvfs-backends  0.2.1-1        userspace virtual filesystem - backends

Can you help?

I have an RC bug in deb-gview that I need to fix [2] and I wanted to do
the two jobs in one but it's looking now as if I'll need two uploads,
0.1.6 to unstable just to fix the existing bug and 0.2.0 to experimental
with partially broken functionality. It's a shame because I've got
everything else working using GIO - it is only the GVfs part that is
giving errors.

[0] http://dpkg-view.alioth.debian.org/
[1] http://alioth.debian.org/plugins/scmcvs/cvsweb.php/dpkg-view/?cvsroot=dpkg-view
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471611

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20080322/05b2820c/attachment.pgp 


More information about the pkg-gnome-maintainers mailing list