<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[150503] trunk/dports/fuse/sshfs</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/150503">150503</a></dd>
<dt>Author</dt> <dd>aronnax@macports.org</dd>
<dt>Date</dt> <dd>2016-07-20 09:53:47 -0700 (Wed, 20 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>sshfs: update to 2.8 (now on github)</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsfusesshfsPortfile">trunk/dports/fuse/sshfs/Portfile</a></li>
<li><a href="#trunkdportsfusesshfsfilespatchconfigureacdiff">trunk/dports/fuse/sshfs/files/patch-configure.ac.diff</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsfusesshfsfilespatchfromfuse4xdiff">trunk/dports/fuse/sshfs/files/patch-from-fuse4x.diff</a></li>
<li><a href="#trunkdportsfusesshfsfilespatchsshfs1diff">trunk/dports/fuse/sshfs/files/patch-sshfs.1.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsfusesshfsPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/fuse/sshfs/Portfile (150502 => 150503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/fuse/sshfs/Portfile        2016-07-20 16:40:55 UTC (rev 150502)
+++ trunk/dports/fuse/sshfs/Portfile        2016-07-20 16:53:47 UTC (rev 150503)
</span><span class="lines">@@ -1,10 +1,10 @@
</span><span class="cx"> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
</span><span class="cx"> # $Id$
</span><span class="cx"> 
</span><del>-PortSystem 1.0
</del><ins>+PortSystem          1.0
+PortGroup           github 1.0
</ins><span class="cx"> 
</span><del>-name                sshfs
-version             2.5
</del><ins>+github.setup        libfuse sshfs 2.8 sshfs_
</ins><span class="cx"> categories          fuse
</span><span class="cx"> 
</span><span class="cx"> platforms           darwin
</span><span class="lines">@@ -18,17 +18,11 @@
</span><span class="cx">                     mounting the filesystem is as easy as logging \
</span><span class="cx">                     into the server with ssh.
</span><span class="cx"> 
</span><del>-homepage            http://fuse.sourceforge.net/sshfs.html
-
-distname            sshfs-fuse-${version}
-master_sites        sourceforge:fuse
</del><span class="cx"> license             GPL-2
</span><span class="cx"> 
</span><del>-checksums           rmd160  055b4d39de5836fa6638eaca642b55b3cd939d02 \
-                    sha256  e9171452e5d0150b9c6a2158fd2e2dcefb5d5d03ba4d208949e00a3a46c6e63e
</del><ins>+checksums           rmd160  85425d3198f5c0d8ae0d5a456a37b6294744f7c2 \
+                    sha256  2cafba9ff65a3e97a7a9aba4a7b83e683b598ffdac317c802bb8d166b1c4715a
</ins><span class="cx"> 
</span><del>-livecheck.distname  sshfs-fuse
-
</del><span class="cx"> depends_build       path:bin/pkg-config:pkgconfig
</span><span class="cx"> depends_lib         port:gettext \
</span><span class="cx">                     path:lib/pkgconfig/glib-2.0.pc:glib2 \
</span><span class="lines">@@ -36,17 +30,9 @@
</span><span class="cx">                     port:libiconv \
</span><span class="cx">                     bin:ssh:openssh
</span><span class="cx"> 
</span><del>-patchfiles          patch-from-fuse4x.diff \
-                    patch-configure.ac.diff \
-                    patch-sshfs.1.diff
-patch.pre_args      -p1
</del><ins>+patchfiles          patch-configure.ac.diff
</ins><span class="cx"> 
</span><span class="cx"> # osxfuse is -universal
</span><span class="cx"> universal_variant no
</span><span class="cx"> 
</span><del>-post-patch {
-    # automake 1.13 compatibility (see #37513)
-    reinplace &quot;s|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|&quot; ${worksrcpath}/configure.ac
-}
-
</del><span class="cx"> use_autoreconf      yes
</span></span></pre></div>
<a id="trunkdportsfusesshfsfilespatchconfigureacdiff"></a>
<div class="modfile"><h4>Modified: trunk/dports/fuse/sshfs/files/patch-configure.ac.diff (150502 => 150503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/fuse/sshfs/files/patch-configure.ac.diff        2016-07-20 16:40:55 UTC (rev 150502)
+++ trunk/dports/fuse/sshfs/files/patch-configure.ac.diff        2016-07-20 16:53:47 UTC (rev 150503)
</span><span class="lines">@@ -1,10 +1,19 @@
</span><del>---- sshfs-fuse-2.3/configure.ac.orig        2011-08-11 17:47:30.000000000 -0400
-+++ sshfs-fuse-2.3/configure.ac        2011-08-11 17:48:03.000000000 -0400
-@@ -36,7 +36,6 @@
</del><ins>+--- configure.ac.orig        2016-07-20 12:37:24.000000000 -0400
++++ configure.ac        2016-07-20 12:38:27.000000000 -0400
+@@ -1,7 +1,7 @@
+ AC_INIT(sshfs, 2.8)
+ AC_CANONICAL_TARGET
+ AM_INIT_AUTOMAKE([foreign subdir-objects])
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
</ins><span class="cx">  
</span><ins>+ AC_PROG_CC
+ AM_PROG_CC_C_O
+@@ -43,7 +43,6 @@

</ins><span class="cx">  AM_CONDITIONAL(SSH_NODELAY_SO, test &quot;$enable_sshnodelay&quot; = &quot;yes&quot;)
</span><span class="cx">  
</span><span class="cx"> -export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
</span><del>- PKG_CHECK_MODULES(SSHFS, [fuse &gt;= 2.3 glib-2.0 gthread-2.0])
</del><ins>+ PKG_CHECK_MODULES([SSHFS], [fuse &gt;= 2.3 glib-2.0 gthread-2.0])
</ins><span class="cx">  have_fuse_opt_parse=no
</span><span class="cx">  oldlibs=&quot;$LIBS&quot;
</span></span></pre></div>
<a id="trunkdportsfusesshfsfilespatchfromfuse4xdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/fuse/sshfs/files/patch-from-fuse4x.diff (150502 => 150503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/fuse/sshfs/files/patch-from-fuse4x.diff        2016-07-20 16:40:55 UTC (rev 150502)
+++ trunk/dports/fuse/sshfs/files/patch-from-fuse4x.diff        2016-07-20 16:53:47 UTC (rev 150503)
</span><span class="lines">@@ -1,706 +0,0 @@
</span><del>-diff --git a/Makefile.am b/Makefile.am
-index a80788b..99e1dc8 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -2,14 +2,14 @@

- bin_PROGRAMS = sshfs

--sshfs_SOURCES = sshfs.c cache.c cache.h
-+sshfs_SOURCES = sshfs.c cache.c cache.h compat/darwin_semaphore.h compat/darwin_semaphore.c
- if FUSE_OPT_COMPAT
- sshfs_SOURCES += compat/fuse_opt.c compat/fuse_opt.h
- endif

- sshfs_LDADD = $(SSHFS_LIBS)
- sshfs_CFLAGS = $(SSHFS_CFLAGS)
--sshfs_CPPFLAGS = -D_REENTRANT -DFUSE_USE_VERSION=26 -DLIBDIR=\&quot;$(libdir)\&quot;
-+sshfs_CPPFLAGS = -D_REENTRANT -DFUSE_USE_VERSION=26 -DLIBDIR=\&quot;$(libdir)\&quot; -Icompat

- EXTRA_DIST = sshnodelay.c FAQ.txt
- CLEANFILES = sshnodelay.so
-diff --git a/cache.c b/cache.c
-index 2a06726..ab274bc 100644
---- a/cache.c
-+++ b/cache.c
-@@ -553,6 +553,9 @@ struct fuse_operations *cache_init(struct fuse_cache_operations *oper)
-         cache.next_oper = oper;

-         cache_unity_fill(oper, &amp;cache_oper);
-+#ifdef __APPLE__
-+        cache_enabled = cache.on;
-+#endif
-         if (cache.on) {
-                 cache_fill(oper, &amp;cache_oper);
-                 pthread_mutex_init(&amp;cache.lock, NULL);
-@@ -587,3 +590,7 @@ int cache_parse_options(struct fuse_args *args)

-         return fuse_opt_parse(args, &amp;cache, cache_opts, NULL);
- }
-+
-+#ifdef __APPLE__
-+int cache_enabled;
-+#endif
-diff --git a/cache.h b/cache.h
-index cec9ca4..8ca0989 100644
---- a/cache.h
-+++ b/cache.h
-@@ -27,3 +27,7 @@ int cache_parse_options(struct fuse_args *args);
- void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr);
- void cache_invalidate(const char *path);
- uint64_t cache_get_write_ctr(void);
-+
-+#ifdef __APPLE__
-+extern int cache_enabled;
-+#endif
-diff --git a/compat/darwin_semaphore.c b/compat/darwin_semaphore.c
-new file mode 100644
-index 0000000..e45fd9a
---- /dev/null
-+++ b/compat/darwin_semaphore.c
-@@ -0,0 +1,229 @@
-+/*
-+ * Copyright (C) 2000,02 Free Software Foundation, Inc.
-+ * This file is part of the GNU C Library.
-+ * Written by Ga&lt;EB&gt;l Le Mignot &lt;address@hidden&gt;
-+ *
-+ * The GNU C Library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public License as
-+ * published by the Free Software Foundation; either version 2 of the
-+ * License, or (at your option) any later version.
-+ *
-+ * The GNU C Library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+#include &quot;darwin_semaphore.h&quot;
-+
-+#include &lt;assert.h&gt;
-+#include &lt;errno.h&gt;
-+#include &lt;sys/types.h&gt;
-+
-+#define __SEM_ID_NONE  0x0
-+#define __SEM_ID_LOCAL 0xcafef00d
-+
-+/* http://www.opengroup.org/onlinepubs/007908799/xsh/sem_init.html */
-+int
-+compat_sem_init(compat_sem_t *sem, int pshared, unsigned int value)
-+{
-+    if (pshared) {
-+        errno = ENOSYS;
-+        return -1;
-+    }
-+
-+    sem-&gt;id = __SEM_ID_NONE;
-+
-+    if (pthread_cond_init(&amp;sem-&gt;__data.local.count_cond, NULL)) {
-+        goto cond_init_fail;
-+    }
-+
-+    if (pthread_mutex_init(&amp;sem-&gt;__data.local.count_lock, NULL)) {
-+        goto mutex_init_fail;
-+    }
-+
-+    sem-&gt;__data.local.count = value;
-+    sem-&gt;id = __SEM_ID_LOCAL;
-+
-+    return 0;
-+
-+mutex_init_fail:
-+
-+    pthread_cond_destroy(&amp;sem-&gt;__data.local.count_cond);
-+
-+cond_init_fail:
-+
-+    return -1;
-+}
-+
-+/* http://www.opengroup.org/onlinepubs/007908799/xsh/sem_destroy.html */
-+int
-+compat_sem_destroy(compat_sem_t *sem)
-+{
-+    int res = 0;
-+
-+    pthread_mutex_lock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    sem-&gt;id = __SEM_ID_NONE;
-+    pthread_cond_broadcast(&amp;sem-&gt;__data.local.count_cond);
-+
-+    if (pthread_cond_destroy(&amp;sem-&gt;__data.local.count_cond)) {
-+        res = -1;
-+    }
-+
-+    pthread_mutex_unlock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    if (pthread_mutex_destroy(&amp;sem-&gt;__data.local.count_lock)) {
-+        res = -1;
-+    }
-+
-+    return res;
-+}
-+
-+int
-+compat_sem_getvalue(compat_sem_t *sem, unsigned int *sval)
-+{
-+    int res = 0;
-+
-+    pthread_mutex_lock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    if (sem-&gt;id != __SEM_ID_LOCAL) {
-+        res = -1;
-+        errno = EINVAL;
-+    } else {
-+        *sval = sem-&gt;__data.local.count;
-+    }
-+
-+    pthread_mutex_unlock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    return res;
-+}
-+
-+/* http://www.opengroup.org/onlinepubs/007908799/xsh/sem_post.html */
-+int
-+compat_sem_post(compat_sem_t *sem)
-+{
-+    int res = 0;
-+
-+    pthread_mutex_lock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    if (sem-&gt;id != __SEM_ID_LOCAL) {
-+        res = -1;
-+        errno = EINVAL;
-+    } else if (sem-&gt;__data.local.count &lt; COMPAT_SEM_VALUE_MAX) {
-+        sem-&gt;__data.local.count++;
-+        if (sem-&gt;__data.local.count == 1) {
-+            pthread_cond_signal(&amp;sem-&gt;__data.local.count_cond);
-+        }
-+    } else {
-+        errno = ERANGE;
-+        res = -1;
-+    }
-+
-+    pthread_mutex_unlock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    return res;
-+}
-+
-+/* http://www.opengroup.org/onlinepubs/009695399/functions/sem_timedwait.html */
-+int
-+compat_sem_timedwait(compat_sem_t *sem, const struct timespec *abs_timeout)
-+{
-+    int res = 0;
-+
-+    if (abs_timeout &amp;&amp;
-+        (abs_timeout-&gt;tv_nsec &lt; 0 || abs_timeout-&gt;tv_nsec &gt;= 1000000000)) {
-+       errno = EINVAL;
-+       return -1;
-+    }
-+
-+    pthread_cleanup_push((void(*)(void*))&amp;pthread_mutex_unlock,
-+                         &amp;sem-&gt;__data.local.count_lock);
-+
-+    pthread_mutex_lock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    if (sem-&gt;id != __SEM_ID_LOCAL) {
-+        errno = EINVAL;
-+        res = -1;
-+    } else {
-+        if (!sem-&gt;__data.local.count) {
-+            res = pthread_cond_timedwait(&amp;sem-&gt;__data.local.count_cond,
-+                                         &amp;sem-&gt;__data.local.count_lock,
-+                                         abs_timeout);
-+        }
-+        if (res) {
-+            assert(res == ETIMEDOUT);
-+            res = -1;
-+            errno = ETIMEDOUT;
-+        } else if (sem-&gt;id != __SEM_ID_LOCAL) {
-+            res = -1;
-+            errno = EINVAL;
-+        } else {
-+            sem-&gt;__data.local.count--;
-+        }
-+    }
-+
-+    pthread_cleanup_pop(1);
-+
-+    return res;
-+}
-+
-+/* http://www.opengroup.org/onlinepubs/007908799/xsh/sem_trywait.html */
-+int
-+compat_sem_trywait(compat_sem_t *sem)
-+{
-+    int res = 0;
-+
-+    pthread_mutex_lock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    if (sem-&gt;id != __SEM_ID_LOCAL) {
-+        res = -1;
-+        errno = EINVAL;
-+    } else if (sem-&gt;__data.local.count) {
-+        sem-&gt;__data.local.count--;
-+    } else {
-+        res = -1;
-+        errno = EAGAIN;
-+    }
-+
-+    pthread_mutex_unlock (&amp;sem-&gt;__data.local.count_lock);
-+
-+    return res;
-+}
-+
-+/* http://www.opengroup.org/onlinepubs/007908799/xsh/sem_wait.html */
-+int
-+compat_sem_wait(compat_sem_t *sem)
-+{
-+    int res = 0;
-+
-+    pthread_cleanup_push((void(*)(void*))&amp;pthread_mutex_unlock,
-+                          &amp;sem-&gt;__data.local.count_lock);
-+
-+    pthread_mutex_lock(&amp;sem-&gt;__data.local.count_lock);
-+
-+    if (sem-&gt;id != __SEM_ID_LOCAL) {
-+        errno = EINVAL;
-+        res = -1;
-+    } else {
-+        while (!sem-&gt;__data.local.count) {
-+            pthread_cond_wait(&amp;sem-&gt;__data.local.count_cond,
-+                              &amp;sem-&gt;__data.local.count_lock);
-+        }
-+        if (sem-&gt;id != __SEM_ID_LOCAL) {
-+            res = -1;
-+            errno = EINVAL;
-+        } else {
-+            sem-&gt;__data.local.count--;
-+        }
-+    }
-+
-+    pthread_cleanup_pop(1);
-+
-+    return res;
-+}
-diff --git a/compat/darwin_semaphore.h b/compat/darwin_semaphore.h
-new file mode 100644
-index 0000000..3f03e41
---- /dev/null
-+++ b/compat/darwin_semaphore.h
-@@ -0,0 +1,69 @@
-+/* Copyright (C) 2000,02 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+   Written by GaĆ«l Le Mignot &lt;address@hidden&gt;
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Library General Public License as
-+   published by the Free Software Foundation; either version 2 of the
-+   License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+// This implementation is based on libsem http://lists.debian.org/debian-devel/2004/08/msg00612.html
-+
-+#ifndef _SEMAPHORE_H_
-+#define _SEMAPHORE_H_
-+
-+/* Caller must not include &lt;semaphore.h&gt; */
-+
-+#include &lt;pthread.h&gt;
-+
-+struct __local_sem_t
-+{
-+    unsigned int    count;
-+    pthread_mutex_t count_lock;
-+    pthread_cond_t  count_cond;
-+};
-+
-+typedef struct compat_sem {
-+    unsigned int id;
-+    union {
-+        struct __local_sem_t local;
-+    } __data;
-+} compat_sem_t;
-+
-+#define COMPAT_SEM_VALUE_MAX ((int32_t)32767)
-+
-+int compat_sem_init(compat_sem_t *sem, int pshared, unsigned int value);
-+int compat_sem_destroy(compat_sem_t *sem);
-+int compat_sem_getvalue(compat_sem_t *sem, unsigned int *value);
-+int compat_sem_post(compat_sem_t *sem);
-+int compat_sem_timedwait(compat_sem_t *sem, const struct timespec *abs_timeout);
-+int compat_sem_trywait(compat_sem_t *sem);
-+int compat_sem_wait(compat_sem_t *sem);
-+
-+
-+/* Redefine semaphores. Caller must not include &lt;semaphore.h&gt; */
-+
-+typedef compat_sem_t sem_t;
-+
-+#define sem_init(s, p, v)   compat_sem_init(s, p, v)
-+#define sem_destroy(s)      compat_sem_destroy(s)
-+#define sem_getvalue(s, v)  compat_sem_getvalue(s, v)
-+#define sem_post(s)         compat_sem_post(s)
-+#define sem_timedwait(s, t) compat_sem_timedwait(s, t)
-+#define sem_trywait(s)      compat_sem_trywait(s)
-+#define sem_wait(s)         compat_sem_wait(s)
-+
-+#define SEM_VALUE_MAX       COMPAT_SEM_VALUE_MAX
-+
-+
-+#endif /* semaphore.h */
-diff --git a/sshfs.c b/sshfs.c
-index 7cfa341..39f3286 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -20,7 +20,11 @@
- #include &lt;string.h&gt;
- #include &lt;stdint.h&gt;
- #include &lt;errno.h&gt;
-+#ifdef __APPLE__
-+#include &lt;darwin_semaphore.h&gt;
-+#else
- #include &lt;semaphore.h&gt;
-+#endif
- #include &lt;pthread.h&gt;
- #include &lt;netdb.h&gt;
- #include &lt;signal.h&gt;
-@@ -38,6 +42,10 @@
- #include &lt;pwd.h&gt;
- #include &lt;grp.h&gt;
- #include &lt;limits.h&gt;
-+#ifdef __APPLE__
-+#include &lt;libgen.h&gt;
-+#include &lt;strings.h&gt;
-+#endif

- #include &quot;cache.h&quot;

-@@ -121,6 +129,16 @@

- #define SSHNODELAY_SO &quot;sshnodelay.so&quot;

-+#ifdef __APPLE__
-+
-+#ifndef LIBDIR
-+#define LIBDIR &quot;/usr/local/lib&quot;
-+#endif
-+
-+static char sshfs_program_path[PATH_MAX] = { 0 };
-+
-+#endif
-+
- struct buffer {
-         uint8_t *p;
-         size_t len;
-@@ -183,6 +201,9 @@ struct sshfs_file {
-         int connver;
-         int modifver;
-         int refs;
-+#ifdef __APPLE__
-+        pthread_mutex_t file_lock;
-+#endif
- };

- struct sshfs {
-@@ -234,6 +255,10 @@ struct sshfs {
-         int server_version;
-         unsigned remote_uid;
-         unsigned local_uid;
-+#ifdef __APPLE__
-+        unsigned remote_gid;
-+        unsigned local_gid;
-+#endif
-         int remote_uid_detected;
-         unsigned blksize;
-         char *progname;
-@@ -727,8 +752,17 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp)
-                 }
-         }

-+#ifdef __APPLE__
-+        if (sshfs.remote_uid_detected) {
-+                if (uid == sshfs.remote_uid)
-+                        uid = sshfs.local_uid;
-+                if (gid == sshfs.remote_gid)
-+                        gid = sshfs.local_gid;
-+        }
-+#else
-         if (sshfs.remote_uid_detected &amp;&amp; uid == sshfs.remote_uid)
-                 uid = sshfs.local_uid;
-+#endif
-         if (sshfs.idmap == IDMAP_FILE &amp;&amp; sshfs.uid_map)
-                 if (translate_id(&amp;uid, sshfs.uid_map) == -1)
-                         return -EPERM;
-@@ -837,11 +871,33 @@ static void ssh_add_arg(const char *arg)
- #ifdef SSH_NODELAY_WORKAROUND
- static int do_ssh_nodelay_workaround(void)
- {
-+#ifdef __APPLE__
-+        char *oldpreload = getenv(&quot;DYLD_INSERT_LIBRARIES&quot;);
-+#else
-         char *oldpreload = getenv(&quot;LD_PRELOAD&quot;);
-+#endif
-         char *newpreload;
-         char sopath[PATH_MAX];
-         int res;

-+#ifdef __APPLE__
-+        char *sshfs_program_path_base = NULL;
-+        if (!sshfs_program_path[0]) {
-+                goto nobundle;
-+        }
-+        sshfs_program_path_base = dirname(sshfs_program_path);
-+        if (!sshfs_program_path_base) {
-+                goto nobundle;
-+        }
-+        snprintf(sopath, sizeof(sopath), &quot;%s/%s&quot;, sshfs_program_path_base,
-+                SSHNODELAY_SO);
-+        res = access(sopath, R_OK);
-+        if (res == -1) {
-+                goto nobundle;
-+        }
-+        goto pathok;
-+nobundle:
-+#endif
-         snprintf(sopath, sizeof(sopath), &quot;%s/%s&quot;, LIBDIR, SSHNODELAY_SO);
-         res = access(sopath, R_OK);
-         if (res == -1) {
-@@ -866,16 +922,24 @@ static int do_ssh_nodelay_workaround(void)
-                         return -1;
-                 }
-         }
-+#ifdef __APPLE__
-+pathok:
-+#endif

-         newpreload = g_strdup_printf(&quot;%s%s%s&quot;,
-                                      oldpreload ? oldpreload : &quot;&quot;,
-                                      oldpreload ? &quot; &quot; : &quot;&quot;,
-                                      sopath);

-+#ifdef __APPLE__
-+        if (!newpreload || setenv(&quot;DYLD_INSERT_LIBRARIES&quot;, newpreload, 1) == -1)
-+                fprintf(stderr, &quot;warning: failed set DYLD_INSERT_LIBRARIES for ssh nodelay workaround\n&quot;);
-+#else
-         if (!newpreload || setenv(&quot;LD_PRELOAD&quot;, newpreload, 1) == -1) {
-                 fprintf(stderr, &quot;warning: failed set LD_PRELOAD &quot;
-                         &quot;for ssh nodelay workaround\n&quot;);
-         }
-+#endif
-         g_free(newpreload);
-         return 0;
- }
-@@ -1595,6 +1659,10 @@ static void sftp_detect_uid()

-         sshfs.remote_uid = stbuf.st_uid;
-         sshfs.local_uid = getuid();
-+#ifdef __APPLE__
-+        sshfs.remote_gid = stbuf.st_gid;
-+        sshfs.local_gid = getgid();
-+#endif
-         sshfs.remote_uid_detected = 1;
-         DEBUG(&quot;remote_uid = %i\n&quot;, sshfs.remote_uid);

-@@ -2238,6 +2306,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid)
-         buf_init(&amp;buf, 0);
-         buf_add_path(&amp;buf, path);
-         buf_add_uint32(&amp;buf, SSH_FILEXFER_ATTR_UIDGID);
-+#ifdef __APPLE__
-+        if (sshfs.remote_uid_detected) {
-+                if (uid == sshfs.local_uid)
-+                        uid = sshfs.remote_uid;
-+                if (gid == sshfs.local_gid)
-+                        gid = sshfs.remote_gid;
-+        }
-+#endif
-         buf_add_uint32(&amp;buf, uid);
-         buf_add_uint32(&amp;buf, gid);
-         err = sftp_request(SSH_FXP_SETSTAT, &amp;buf, SSH_FXP_STATUS, NULL);
-@@ -2334,6 +2410,9 @@ static int sshfs_open_common(const char *path, mode_t mode,
-         sf = g_new0(struct sshfs_file, 1);
-         list_init(&amp;sf-&gt;write_reqs);
-         pthread_cond_init(&amp;sf-&gt;write_finished, NULL);
-+#ifdef __APPLE__
-+        pthread_mutex_init(&amp;sf-&gt;file_lock, NULL);
-+#endif
-         /* Assume random read after open */
-         sf-&gt;is_seq = 0;
-         sf-&gt;refs = 1;
-@@ -2368,11 +2447,21 @@ static int sshfs_open_common(const char *path, mode_t mode,
-         }

-         if (!err) {
-+#ifdef __APPLE__
-+                if (cache_enabled)
-+                        cache_add_attr(path, &amp;stbuf, wrctr);
-+#else
-                 cache_add_attr(path, &amp;stbuf, wrctr);
-+#endif
-                 buf_finish(&amp;sf-&gt;handle);
-                 fi-&gt;fh = (unsigned long) sf;
-         } else {
-+#ifdef __APPLE__
-+                if (cache_enabled)
-+                        cache_invalidate(path);
-+#else
-                 cache_invalidate(path);
-+#endif
-                 g_free(sf);
-         }
-         buf_free(&amp;buf);
-@@ -2427,14 +2516,32 @@ static int sshfs_fsync(const char *path, int isdatasync,

- static void sshfs_file_put(struct sshfs_file *sf)
- {
-+#ifdef __APPLE__
-+        pthread_mutex_lock(&amp;sf-&gt;file_lock);
-+#endif
-         sf-&gt;refs--;
-+#ifdef __APPLE__
-+        if (!sf-&gt;refs) {
-+                pthread_mutex_unlock(&amp;sf-&gt;file_lock);
-+                g_free(sf);
-+        } else {
-+                pthread_mutex_unlock(&amp;sf-&gt;file_lock);
-+        }
-+#else
-         if (!sf-&gt;refs)
-                 g_free(sf);
-+#endif
- }

- static void sshfs_file_get(struct sshfs_file *sf)
- {
-+#ifdef __APPLE__
-+        pthread_mutex_lock(&amp;sf-&gt;file_lock);
-+#endif
-         sf-&gt;refs++;
-+#ifdef __APPLE__
-+        pthread_mutex_unlock(&amp;sf-&gt;file_lock);
-+#endif
- }

- static int sshfs_release(const char *path, struct fuse_file_info *fi)
-@@ -3352,6 +3459,15 @@ static int read_password(void)
-                 perror(&quot;Failed to allocate locked page for password&quot;);
-                 return -1;
-         }
-+#ifdef __APPLE__
-+        if (mlock(sshfs.password, size) != 0) {
-+                memset(sshfs.password, 0, size);
-+                munmap(sshfs.password, size);
-+                sshfs.password = NULL;
-+                perror(&quot;Failed to allocate locked page for password&quot;);
-+                return -1;
-+        }
-+#endif /* __APPLE__ */

-         /* Don't use fgets() because password might stay in memory */
-         for (n = 0; n &lt; max_password; n++) {
-@@ -3677,8 +3793,13 @@ static inline void load_gid_map(void)
-         read_id_map(sshfs.gid_file, &amp;groupname_to_gid, &quot;gid&quot;, &amp;sshfs.gid_map, &amp;sshfs.r_gid_map);
- }

--int main(int argc, char *argv[])
-+int main(int argc, char *argv[], __unused char *envp[], char **exec_path)
- {
-+#ifdef __APPLE__
-+        if (!realpath(*exec_path, sshfs_program_path)) {
-+                memset(sshfs_program_path, 0, PATH_MAX);
-+        }
-+#endif
-         int res;
-         struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
-         char *tmp;
-@@ -3686,6 +3807,10 @@ int main(int argc, char *argv[])
-         const char *sftp_server;
-         int libver;

-+#ifdef __APPLE__
-+        /* Until this gets fixed somewhere else. */
-+        g_slice_set_config(G_SLICE_CONFIG_ALWAYS_MALLOC, TRUE);
-+#endif /* __APPLE__ */
-         g_thread_init(NULL);

-         sshfs.blksize = 4096;
-@@ -3694,7 +3819,11 @@ int main(int argc, char *argv[])
-         sshfs.max_write = 32768;
-         sshfs.nodelay_workaround = 1;
-         sshfs.nodelaysrv_workaround = 0;
-+#ifdef __APPLE__
-+        sshfs.rename_workaround = 1;
-+#else
-         sshfs.rename_workaround = 0;
-+#endif /* __APPLE__ */
-         sshfs.truncate_workaround = 0;
-         sshfs.buflimit_workaround = 1;
-         sshfs.ssh_ver = 2;
-@@ -3713,6 +3842,10 @@ int main(int argc, char *argv[])
-         ssh_add_arg(&quot;-a&quot;);
-         ssh_add_arg(&quot;-oClearAllForwardings=yes&quot;);

-+#ifdef __APPLE__
-+        sshfs.detect_uid = 1;
-+#endif
-+
-         if (fuse_opt_parse(&amp;args, &amp;sshfs, sshfs_opts, sshfs_opt_proc) == -1 ||
-             parse_workarounds() == -1)
-                 exit(1);
-diff --git a/sshnodelay.c b/sshnodelay.c
-index 7518089..efe393c 100644
---- a/sshnodelay.c
-+++ b/sshnodelay.c
-@@ -5,6 +5,32 @@
- #include &lt;netinet/in.h&gt;
- #include &lt;netinet/tcp.h&gt;

-+#ifdef __APPLE__
-+
-+int custom_connect(int sock, const struct sockaddr *addr, socklen_t addrlen);
-+
-+typedef struct interpose_s {
-+        void *new_func;
-+        void *orig_func;
-+} interpose_t;
-+
-+static const interpose_t interposers[] \
-+        __attribute__ ((section(&quot;__DATA, __interpose&quot;))) = {
-+        { (void *)custom_connect,  (void *)connect  },
-+};
-+
-+int custom_connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
-+{
-+        int res = connect(sock, addr, addrlen);
-+        if (!res &amp;&amp; addr-&gt;sa_family == AF_INET) {
-+                int opt = 1;
-+                setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &amp;opt, sizeof(opt));
-+        }
-+        return res;
-+}
-+
-+#else
-+
- int connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
- {
-         int (*next_connect)(int, const struct sockaddr *, socklen_t) =
-@@ -16,3 +42,5 @@ int connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
-         }
-         return res;
- }
-+
-+#endif
</del></span></pre></div>
<a id="trunkdportsfusesshfsfilespatchsshfs1diff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/fuse/sshfs/files/patch-sshfs.1.diff (150502 => 150503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/fuse/sshfs/files/patch-sshfs.1.diff        2016-07-20 16:40:55 UTC (rev 150502)
+++ trunk/dports/fuse/sshfs/files/patch-sshfs.1.diff        2016-07-20 16:53:47 UTC (rev 150503)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>---- sshfs-fuse-2.4/sshfs.1.orig        2012-08-23 10:13:26.000000000 +0200
-+++ sshfs-fuse-2.4/sshfs.1        2012-08-23 10:13:51.000000000 +0200
-@@ -7,7 +7,7 @@
- \fBsshfs\fP [\fIuser\fP@]\fBhost\fP:[\fIdir\fP] \fBmountpoint\fP [\fIoptions\fP]
- .SS unmounting
- .TP
--\fBfusermount -u mountpoint\fP
-+\fBumount mountpoint\fP
- .SH DESCRIPTION
- SSHFS (Secure SHell FileSystem) is a file system for Linux (and other
- operating systems with a FUSE implementation, such as Mac OS X or FreeBSD)
</del></span></pre>
</div>
</div>

</body>
</html>