pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/filesystems/py-fuse-bindings Update to fuse-python-1.0...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/310ad45f211c
branches:  trunk
changeset: 770379:310ad45f211c
user:      pho <pho%pkgsrc.org@localhost>
date:      Tue Nov 30 05:25:57 2021 +0000

description:
Update to fuse-python-1.0.4; now it supports Python 3

* v1.0.3
unbreak xmp.py for python2

* v1.0.2
fix race in xmp.py (Carl Drougge)
fix surrogateescape handling in fsyncdir/readdir/write (Carl Drougge)

* v1.0.1
Improve path handling for Python >= 3.6 (thanks to seahawk1986 for the
patch)

* v1.0.0
IOCTL definitions to fix compilation on FreeBSD (patch from Mikhail
Zakharov zmey20000%yahoo.com@localhost)

Add poll support (patch from David Lechner david%lechnology.com@localhost)

Use bytes objects for read and write data: please note that while this
has no effect on Python 2,it is a breaking change in Python 3; it's
worth it however since it fixes a serious usability bug that
arbitrarily limited file content to valid UTF-8 data (patch from David
Lechner david%lechnology.com@localhost)

* v0.3.1
IOCTL support added by Cédric Carrée

* 0.3.0
Add Python 3 compatibility.

diffstat:

 filesystems/py-fuse-bindings/Makefile                               |   17 +-
 filesystems/py-fuse-bindings/PLIST                                  |    8 +-
 filesystems/py-fuse-bindings/distinfo                               |   10 +-
 filesystems/py-fuse-bindings/patches/patch-fuseparts___fusemodule.c |  189 ++++++++-
 4 files changed, 173 insertions(+), 51 deletions(-)

diffs (292 lines):

diff -r 93763859998d -r 310ad45f211c filesystems/py-fuse-bindings/Makefile
--- a/filesystems/py-fuse-bindings/Makefile     Tue Nov 30 00:48:57 2021 +0000
+++ b/filesystems/py-fuse-bindings/Makefile     Tue Nov 30 05:25:57 2021 +0000
@@ -1,29 +1,26 @@
-# $NetBSD: Makefile,v 1.19 2019/09/02 13:20:22 adam Exp $
+# $NetBSD: Makefile,v 1.20 2021/11/30 05:25:57 pho Exp $
 
-VERSION=               0.2.1
+VERSION=               1.0.4
 DISTNAME=              fuse-python-${VERSION}
 PKGNAME=               ${PYPKGPREFIX}-fuse-bindings-${VERSION}
 CATEGORIES=            filesystems python
-MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=fuse/fuse-python}/
+MASTER_SITES=          ${MASTER_SITE_PYPI:=f/fuse-python/}
 
 MAINTAINER=            pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=              https://pypi.python.org/pypi/fuse-python
 COMMENT=               Python bindings for FUSE and refuse
 LICENSE=               gnu-lgpl-v2.1
 
-PYDISTUTILSPKG=                yes
-PY_PATCHLIST=          yes
 USE_TOOLS+=            pkg-config
 
-PYTHON_VERSIONS_ACCEPTED=      27 # not yet ported as of 0.2.1
-
-INSTALLATION_DIRS=     share/examples/fuse-python
+EGDIR=                 share/examples/${PKGBASE}
+INSTALLATION_DIRS=     ${EGDIR}
 
 post-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/example/hello.py \
-               ${DESTDIR}${PREFIX}/share/examples/fuse-python/
+               ${DESTDIR}${PREFIX}/${EGDIR}
        ${INSTALL_SCRIPT} ${WRKSRC}/example/xmp.py \
-               ${DESTDIR}${PREFIX}/share/examples/fuse-python/
+               ${DESTDIR}${PREFIX}/${EGDIR}
 
 .include "../../lang/python/egg.mk"
 
diff -r 93763859998d -r 310ad45f211c filesystems/py-fuse-bindings/PLIST
--- a/filesystems/py-fuse-bindings/PLIST        Tue Nov 30 00:48:57 2021 +0000
+++ b/filesystems/py-fuse-bindings/PLIST        Tue Nov 30 05:25:57 2021 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2011/12/16 12:51:56 gdt Exp $
+@comment $NetBSD: PLIST,v 1.8 2021/11/30 05:25:57 pho Exp $
 ${PYSITELIB}/fuse.py
 ${PYSITELIB}/fuse.pyc
 ${PYSITELIB}/fuse.pyo
@@ -9,12 +9,12 @@
 ${PYSITELIB}/fuseparts/__init__.py
 ${PYSITELIB}/fuseparts/__init__.pyc
 ${PYSITELIB}/fuseparts/__init__.pyo
-${PYSITELIB}/fuseparts/_fusemodule.so
+${PYSITELIB}/fuseparts/_fuse.so
 ${PYSITELIB}/fuseparts/setcompatwrap.py
 ${PYSITELIB}/fuseparts/setcompatwrap.pyc
 ${PYSITELIB}/fuseparts/setcompatwrap.pyo
 ${PYSITELIB}/fuseparts/subbedopts.py
 ${PYSITELIB}/fuseparts/subbedopts.pyc
 ${PYSITELIB}/fuseparts/subbedopts.pyo
-share/examples/fuse-python/hello.py
-share/examples/fuse-python/xmp.py
+share/examples/py39-fuse-bindings/hello.py
+share/examples/py39-fuse-bindings/xmp.py
diff -r 93763859998d -r 310ad45f211c filesystems/py-fuse-bindings/distinfo
--- a/filesystems/py-fuse-bindings/distinfo     Tue Nov 30 00:48:57 2021 +0000
+++ b/filesystems/py-fuse-bindings/distinfo     Tue Nov 30 05:25:57 2021 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.5 2021/10/26 10:25:30 nia Exp $
+$NetBSD: distinfo,v 1.6 2021/11/30 05:25:57 pho Exp $
 
-BLAKE2s (fuse-python-0.2.1.tar.gz) = 92bffd23b2c29a128feec8d0394795f310cefb552183ebb66fbaaff91e01be81
-SHA512 (fuse-python-0.2.1.tar.gz) = f89c738352ca23e92b5c0222dde0a13bbee4d86432e9c339080203ed5bf4f885c42a0a3a252ed485f26b569d87e68dc0d78c55d8f7b2f3ce0cbac8afb251bdaa
-Size (fuse-python-0.2.1.tar.gz) = 57833 bytes
-SHA1 (patch-fuseparts___fusemodule.c) = 67edc36988220f7c366ea6fdf0f48e90b9706cc1
+BLAKE2s (fuse-python-1.0.4.tar.gz) = 32f3c1aeaf619880a0a366866b3e7650924b66eaafa187d6081dc3c94e1ac568
+SHA512 (fuse-python-1.0.4.tar.gz) = 12696c78f75591e56e00ca1e2a93b214993b939cac2e7aae5dc6d8e69dc1aa034f0244a876c9ff2fb7e49b928b7ff84b281fd98d8f3fe67140be33d7ea5fea20
+Size (fuse-python-1.0.4.tar.gz) = 49009 bytes
+SHA1 (patch-fuseparts___fusemodule.c) = b41472254c8db0f996e2a6691dbc6cc317285544
diff -r 93763859998d -r 310ad45f211c filesystems/py-fuse-bindings/patches/patch-fuseparts___fusemodule.c
--- a/filesystems/py-fuse-bindings/patches/patch-fuseparts___fusemodule.c       Tue Nov 30 00:48:57 2021 +0000
+++ b/filesystems/py-fuse-bindings/patches/patch-fuseparts___fusemodule.c       Tue Nov 30 05:25:57 2021 +0000
@@ -1,17 +1,151 @@
-$NetBSD: patch-fuseparts___fusemodule.c,v 1.1 2011/12/16 00:50:47 gdt Exp $
+$NetBSD: patch-fuseparts___fusemodule.c,v 1.2 2021/11/30 05:25:58 pho Exp $
 
 /*
  * This patch is not known to be filed upstream.
- * 
+ *
  * It adapts for NetBSD's (re)fuse implementation, specifically
  *   the lack of an attribute (rdev)
- *   [something about loop that I don't understand]
- *   stubbing out fuse_invalidate calls (because refuse doesn't support them?)
+ *   the lack of fuse_loop_mt(), fuse_invalidate(), fuse_setup(), and fuse_teardown()
+ *   the lack of polling support
  */
 
---- fuseparts/_fusemodule.c.orig       2010-04-14 22:29:21.000000000 +0000
+--- fuseparts/_fusemodule.c.orig       2021-05-02 06:20:20.000000000 +0000
 +++ fuseparts/_fusemodule.c
-@@ -213,7 +213,7 @@ fi_to_py(struct fuse_file_info *fi)
+@@ -33,6 +33,133 @@
+    to fix compilation errors on FreeBSD
+    Mikhail Zakharov <zmey20000%thoo.com@localhost> 2018.10.22 */
+ 
++#if defined(__NetBSD__)
++
++/* NetBSD librefuse doesn't support fuse_loop_mt() yet. Use the
++ * single-threaded loop instead. This is harmless, only a missed
++ * opportunity for performance gain. */
++#  define fuse_loop_mt(fuse) fuse_loop(fuse)
++
++/* NetBSD librefuse doesn't support fuse_invalidate() yet. Make it
++ * no-op. This too is harmless because librefuse caches nothing
++ * atm. */
++#  define fuse_invalidate(fuse, path) 0
++
++/* fuse_setup() has been superseded by fuse_new(). */
++#include <fuse_lowlevel.h>
++#include <signal.h>
++
++static void exit_handler(int sig __attribute__((__unused__)))
++{
++    struct fuse_context *ctx = fuse_get_context();
++
++    if (ctx)
++        fuse_exit(ctx->fuse);
++}
++
++static int set_signal_handler(int sig, void (*handler)(int))
++{
++    struct sigaction sa;
++    struct sigaction old_sa;
++
++    memset(&sa, 0, sizeof(struct sigaction));
++    sa.sa_handler = handler;
++    sigemptyset(&sa.sa_mask);
++    sa.sa_flags = 0;
++
++    if (sigaction(sig, NULL, &old_sa) == -1)
++        return -1;
++
++    if (old_sa.sa_handler == SIG_DFL)
++        if (sigaction(sig, &sa, NULL) == -1)
++            return -1;
++
++    return 0;
++}
++
++static int fuse_set_signal_handlers()
++{
++      if (set_signal_handler(SIGHUP, exit_handler) == -1 ||
++              set_signal_handler(SIGINT, exit_handler) == -1 ||
++              set_signal_handler(SIGTERM, exit_handler) == -1 ||
++              set_signal_handler(SIGPIPE, SIG_IGN) == -1)
++              return -1;
++
++      return 0;
++}
++
++static void fuse_remove_signal_handlers()
++{
++      set_signal_handler(SIGHUP, SIG_DFL);
++      set_signal_handler(SIGINT, SIG_DFL);
++      set_signal_handler(SIGTERM, SIG_DFL);
++      set_signal_handler(SIGPIPE, SIG_DFL);
++}
++
++static struct fuse *fuse_setup(
++      int argc, char **argv,
++      const struct fuse_operations *ops, size_t size,
++      char **mountpoint, int *multithreaded, void *userdata)
++{
++      struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
++      struct fuse_cmdline_opts opts;
++      struct fuse* fuse = NULL;
++
++      if (fuse_parse_cmdline(&args, &opts) == -1)
++              return NULL;
++
++      if (opts.show_version)
++              fuse_lowlevel_version();
++
++      if (opts.show_help) {
++              printf("Usage: %s [options] mountpoint\n\n", args.argv[0]);
++              fuse_cmdline_help();
++      }
++
++      if (opts.mountpoint == NULL) {
++              fprintf(stderr, "fuse: no mountpoint specified\n");
++              goto free_args;
++      }
++
++      if (opts.debug)
++              if (fuse_opt_add_arg(&args, "-odebug") == -1)
++                      goto free_args;
++
++      fuse = fuse_new(&args, ops, size, userdata);
++      if (!fuse)
++              goto free_args;
++
++      if (!opts.foreground)
++              if (fuse_daemonize(fuse) == -1)
++                      goto destroy;
++
++      if (fuse_set_signal_handlers() == -1)
++              goto destroy;
++
++      if (fuse_mount(fuse, opts.mountpoint) == -1)
++              goto destroy;
++
++      goto free_args;
++destroy:
++      fuse_destroy(fuse);
++    fuse = NULL;
++free_args:
++      free(opts.mountpoint);
++      fuse_opt_free_args(&args);
++      return fuse;
++}
++
++/* fuse_teardown() has been removed. */
++static void fuse_teardown(
++      struct fuse *fuse,
++      char *mountpoint __attribute__((__unused__)))
++{
++      fuse_remove_signal_handlers();
++      fuse_unmount(fuse);
++      fuse_destroy(fuse);
++}
++#endif /* defined(__NetBSD__) */
++
+ #define _IOC_NRBITS     8
+ #define _IOC_TYPEBITS   8
+ 
+@@ -309,7 +436,7 @@ fi_to_py(struct fuse_file_info *fi)
         * autotools so we just dare to throw these in as is.           \
         */                                                             \
                                                                        \
@@ -20,33 +154,24 @@
        fetchattr_soft_d(st, st_blksize, 4096);                         \
        fetchattr_soft_d(st, st_blocks, (st->st_size + 511)/512)
  
-@@ -903,6 +903,9 @@ bmap_func(const char *path, size_t block
- static int
- pyfuse_loop_mt(struct fuse *f)
+@@ -1598,6 +1725,7 @@ static const char FuseNotifyPoll__doc__[
+ static PyObject *
+ FuseNotifyPoll(PyObject *self, PyObject *arg)
  {
-+#ifdef __NetBSD__
-+      return fuse_loop(f);
-+#else /* __NetBSD__ */
-       int err = -1;
- #ifdef WITH_THREAD
-       PyThreadState *save;
-@@ -916,6 +919,7 @@ pyfuse_loop_mt(struct fuse *f)
- #endif
++#if FUSE_VERSION >= 28
+       struct fuse_pollhandle *ph;
+       int ret;
+ 
+@@ -1611,6 +1739,12 @@ FuseNotifyPoll(PyObject *self, PyObject 
+       ret = fuse_notify_poll(ph);
  
-       return(err);
-+#endif /* __NetBSD__ */
+       return PyInt_FromLong(ret);
++
++#else /* FUSE_VERSION >= 28 */
++      PyErr_SetString(Py_FuseError, "Polling not supported");
++      return NULL;
++
++#endif /* FUSE_VERSION >= 28 */
  }
  
- static struct fuse *fuse=NULL;
-@@ -1137,7 +1141,11 @@ FuseInvalidate(PyObject *self, PyObject 
- 
-       path = PyString_AsString(arg1);
- 
-+#ifdef __NetBSD__
-+      err = 0;
-+#else
-       err = fuse_invalidate(fuse, path);
-+#endif
- 
-       ret = PyInt_FromLong(err);
- 
+ static PyMethodDef Fuse_methods[] = {



Home | Main Index | Thread Index | Old Index