* gnome-vfs2 cleanups and fixes:

- fix webdav(s) browsing
- don't hardcode /usr/local
- fix some XDG conflicting symbols (from FreeBSD)
- enable gssapi

ok jasper@
This commit is contained in:
ajacoutot 2008-05-04 14:36:44 +00:00
parent 7ede32a06c
commit 6a425a3014
9 changed files with 190 additions and 14 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.30 2008/04/09 13:26:15 jasper Exp $
# $OpenBSD: Makefile,v 1.31 2008/05/04 14:36:44 ajacoutot Exp $
SHARED_ONLY= Yes
@ -8,17 +8,18 @@ COMMENT-smb= samba module for gnome-vfs2
GNOME_PROJECT= gnome-vfs
GNOME_VERSION= 2.20.1
PKGNAME= gnome-vfs2-${VERSION}
PKGNAME-main= gnome-vfs2-${VERSION}p3
PKGNAME-main= gnome-vfs2-${VERSION}p4
PKGNAME-smb= gnome-vfs2-smb-${VERSION}p2
MULTI_PACKAGES= -main -smb
SHARED_LIBS += gnomevfs-2 2000.0 # .2000.0
# GPL/LGPL
# GPLv2/LGPLv2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= crypto dbus-1 glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0 \
m pcre ssl util z
@ -31,7 +32,7 @@ LIB_DEPENDS= ORBit-2.>=2::devel/ORBit2 \
dbus-glib-1.>=3::x11/dbus-glib
RUN_DEPENDS= :gnome-mime-data->=2.0.0:x11/gnome/mime-data
WANTLIB-main= ${WANTLIB} c pthread rpcsvc stdc++
WANTLIB-main= ${WANTLIB} c asn1 gssapi krb5 pthread rpcsvc stdc++
LIB_DEPENDS-main= ${LIB_DEPENDS} \
cdda_interface,cdda_paranoia::audio/cdparanoia \
bz2.>=10::archivers/bzip2 \
@ -54,12 +55,13 @@ CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
pre-build:
perl -pi -e "s,/usr/local,${LOCALBASE},g" ${WRKSRC}/libgnomevfs/xdgmime.c
FAKE_FLAGS= sysconfdir=${PREFIX}/share/examples/gnome-vfs2
post-install:
@${INSTALL_DATA_DIR} ${PREFIX}/share/examples/gnome-vfs2; \
cp -Rp ${WRKINST}/${SYSCONFDIR}/gnome/* ${PREFIX}/share/examples/gnome-vfs2/
post-extract:
${INSTALL} -m 555 ${FILESDIR}/krb5-config ${WRKDIR}/bin
pre-build:
@perl -pi -e "s,/usr/local,${LOCALBASE},g" ${WRKSRC}/libgnomevfs/xdgmime.c
.include <bsd.port.mk>

View File

@ -0,0 +1,12 @@
#! /bin/sh
#
# $OpenBSD: krb5-config,v 1.1 2008/05/04 14:36:44 ajacoutot Exp $
#
case x$1 in
x--libs)
echo '-lgssapi -lkrb5 -lasn1 -lcrypto';;
x--cflags)
echo '-I/usr/include/kerberosV';;
esac
exit 0

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-imported_neon_ne_compress_c,v 1.1 2008/05/04 14:36:44 ajacoutot Exp $
--- imported/neon/ne_compress.c.orig Mon Nov 12 09:37:01 2007
+++ imported/neon/ne_compress.c Sat May 3 13:38:46 2008
@@ -49,7 +49,7 @@ struct ne_decompress_s {
ne_request *request; /* associated request. */
ne_session *session; /* associated session. */
/* temporary buffer for holding inflated data. */
- char outbuf[NE_BUFSIZ];
+ char outbuf[BUFSIZ];
z_stream zstr;
int zstrinit; /* non-zero if zstr has been initialized */

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-imported_neon_ne_defs_h,v 1.1 2008/05/04 14:36:44 ajacoutot Exp $
--- imported/neon/ne_defs.h.orig Mon Nov 12 09:37:01 2007
+++ imported/neon/ne_defs.h Sat May 3 13:38:46 2008
@@ -45,7 +45,3 @@
#define ne_attribute(x)
#define ne_attribute_malloc
#endif
-
-#ifndef NE_BUFSIZ
-#define NE_BUFSIZ 8192
-#endif

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-imported_neon_ne_request_c,v 1.1 2008/05/04 14:36:44 ajacoutot Exp $
--- imported/neon/ne_request.c.orig Mon Nov 12 09:37:01 2007
+++ imported/neon/ne_request.c Sat May 3 13:38:46 2008
@@ -153,7 +153,7 @@ struct ne_request_s {
ne_off_t body_length; /* length of request body */
/* temporary store for response lines. */
- char respbuf[NE_BUFSIZ];
+ char respbuf[BUFSIZ];
/**** Response ***/
@@ -426,7 +426,7 @@ static int send_request_body(ne_request *req, int retr
{
ne_session *const sess = req->session;
ne_off_t progress = 0;
- char buffer[NE_BUFSIZ];
+ char buffer[BUFSIZ];
ssize_t bytes;
NE_DEBUG(NE_DBG_HTTP, "Sending request body:\n");
@@ -612,7 +612,7 @@ void ne_print_request_header(ne_request *req, const ch
const char *format, ...)
{
va_list params;
- char buf[NE_BUFSIZ];
+ char buf[BUFSIZ];
va_start(params, format);
ne_vsnprintf(buf, sizeof buf, format, params);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-libgnomevfs_xdgmime_c,v 1.4 2008/05/04 14:36:44 ajacoutot Exp $
--- libgnomevfs/xdgmime.c.orig Thu Apr 24 12:18:17 2008
+++ libgnomevfs/xdgmime.c Thu Apr 24 12:19:02 2008
@@ -236,7 +236,7 @@ xdg_run_command_on_dirs (XdgDirectoryFunc func,
xdg_data_dirs = getenv ("XDG_DATA_DIRS");
if (xdg_data_dirs == NULL)
- xdg_data_dirs = "/usr/local/share/:/usr/share/";
+ xdg_data_dirs = "!!LOCALBASE!!/share/:/usr/share/";
ptr = xdg_data_dirs;

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-libgnomevfs_xdgmimecache_h,v 1.1 2008/05/04 14:36:44 ajacoutot Exp $
--- libgnomevfs/xdgmimecache.h.orig Mon Mar 10 20:12:45 2008
+++ libgnomevfs/xdgmimecache.h Sun Apr 27 17:10:14 2008
@@ -32,9 +32,19 @@
typedef struct _XdgMimeCache XdgMimeCache;
#ifdef XDG_PREFIX
-#define _xdg_mime_cache_new_from_file XDG_ENTRY(cache_new_from_file)
-#define _xdg_mime_cache_ref XDG_ENTRY(cache_ref)
-#define _xdg_mime_cache_unref XDG_ENTRY(cache_unref)
+#define _xdg_mime_cache_new_from_file XDG_ENTRY(cache_new_from_file)
+#define _xdg_mime_cache_ref XDG_ENTRY(cache_ref)
+#define _xdg_mime_cache_unref XDG_ENTRY(cache_unref)
+#define _xdg_mime_cache_get_mime_type_for_data XDG_ENTRY(cache_get_mime_type_for_data)
+#define _xdg_mime_cache_get_mime_type_for_file XDG_ENTRY(cache_get_mime_type_for_file)
+#define _xdg_mime_cache_get_mime_type_from_file_name XDG_ENTRY(cache_get_mime_type_from_file_name)
+#define _xdg_mime_cache_is_valid_mime_type XDG_ENTRY(cache_is_valid_mime_type)
+#define _xdg_mime_cache_mime_type_equal XDG_ENTRY(cache_mime_type_equal)
+#define _xdg_mime_cache_media_type_equal XDG_ENTRY(cache_media_type_equal)
+#define _xdg_mime_cache_mime_type_subclass XDG_ENTRY(cache_mime_type_subclass)
+#define _xdg_mime_cache_list_mime_parents XDG_ENTRY(cache_list_mime_parents)
+#define _xdg_mime_cache_unalias_mime_type XDG_ENTRY(cache_unalias_mime_type)
+#define _xdg_mime_cache_get_max_buffer_extents XDG_ENTRY(cache_get_max_buffer_extents)
#endif
extern XdgMimeCache **_caches;

View File

@ -0,0 +1,56 @@
$OpenBSD: patch-modules_http-neon-method_c,v 1.1 2008/05/04 14:36:44 ajacoutot Exp $
--- modules/http-neon-method.c.orig Mon Nov 12 09:36:43 2007
+++ modules/http-neon-method.c Mon Apr 28 09:33:03 2008
@@ -1188,7 +1188,7 @@ propfind_result (void *userdata, const char *href, con
time_t time;
gulong size;
ne_uri uri;
- char *unesc_path;
+ char *unesc_path, *unesc_ctx_path;
ctx = (PropfindContext *) userdata;
@@ -1205,10 +1205,10 @@ propfind_result (void *userdata, const char *href, con
info = gnome_vfs_file_info_new ();
unesc_path = ne_path_unescape (uri.path);
info->name = g_path_get_basename (unesc_path);
- NE_FREE (unesc_path);
+ unesc_ctx_path = ne_path_unescape (ctx->path);
DEBUG_HTTP_2 ("Comparing: \n\t[%s] \n\t[%s]", ctx->path, uri.path);
- if (ne_path_compare (ctx->path, uri.path) == 0) {
+ if (ne_path_compare (unesc_ctx_path, unesc_path) == 0) {
DEBUG_HTTP_3 ("target");
ctx->target = info;
@@ -1225,6 +1225,8 @@ propfind_result (void *userdata, const char *href, con
ctx->children = g_list_append (ctx->children, info);
}
+ NE_FREE (unesc_ctx_path);
+ NE_FREE (unesc_path);
ne_uri_free (&uri);
/* getlastmodified */
@@ -2400,19 +2402,12 @@ do_open (GnomeVFSMethod *method,
return result;
}
} else {
- handle->use_range = (mode & GNOME_VFS_OPEN_RANDOM);
+ /* Always try to make Ranged puts */
+ handle->use_range = TRUE;
}
result = http_transfer_start (handle);
- if (result == GNOME_VFS_OK && mode & GNOME_VFS_OPEN_READ) {
-
- if (handle->use_range && ! handle->can_range) {
- /*Review: Not supported or invalid open mode ? */
- result = GNOME_VFS_ERROR_NOT_SUPPORTED;
- }
- }
-
if (result != GNOME_VFS_OK) {
http_file_handle_destroy (handle);
handle = NULL;

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-modules_sftp-method_c,v 1.1 2008/04/09 13:26:15 jasper Exp $
--- modules/sftp-method.c.orig Tue Apr 8 12:24:55 2008
+++ modules/sftp-method.c Tue Apr 8 12:27:29 2008
$OpenBSD: patch-modules_sftp-method_c,v 1.2 2008/05/04 14:36:44 ajacoutot Exp $
--- modules/sftp-method.c.orig Mon Nov 12 09:36:43 2007
+++ modules/sftp-method.c Mon Apr 28 09:15:28 2008
@@ -317,7 +317,7 @@ buffer_send (Buffer *buf, int fd)
g_return_val_if_fail (buf->base != NULL, GNOME_VFS_ERROR_INTERNAL);
@ -708,7 +708,22 @@ $OpenBSD: patch-modules_sftp-method_c,v 1.1 2008/04/09 13:26:15 jasper Exp $
sftp_connection_unlock (handle->connection);
return GNOME_VFS_ERROR_EOF;
}
@@ -3238,7 +3238,7 @@ do_set_file_info (GnomeVFSMethod *method,
@@ -3144,11 +3144,12 @@ do_rename (GnomeVFSMethod *method,
buffer_send (&msg, conn->out_fd);
buffer_free (&msg);
+ res = iobuf_read_result (conn->in_fd, id);
+
+bail:
g_free (old_path);
g_free (new_path);
- res = iobuf_read_result (conn->in_fd, id);
-
sftp_connection_unref (conn);
sftp_connection_unlock (conn);
@@ -3238,7 +3239,7 @@ do_set_file_info (GnomeVFSMethod *method,
guint id;
gchar *path;
@ -717,7 +732,7 @@ $OpenBSD: patch-modules_sftp-method_c,v 1.1 2008/04/09 13:26:15 jasper Exp $
if ((mask & ~(GNOME_VFS_SET_FILE_INFO_NAME |
GNOME_VFS_SET_FILE_INFO_PERMISSIONS |
@@ -3270,7 +3270,7 @@ do_set_file_info (GnomeVFSMethod *method,
@@ -3270,7 +3271,7 @@ do_set_file_info (GnomeVFSMethod *method,
if (res == GNOME_VFS_OK && (mask & GNOME_VFS_SET_FILE_INFO_NAME))
res = do_rename (method, uri, info->name, context);