[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-fuse] branch master updated (cc9aab5 -> b264f99)
From: |
gnunet |
Subject: |
[gnunet-fuse] branch master updated (cc9aab5 -> b264f99) |
Date: |
Wed, 20 Nov 2019 00:00:40 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a change to branch master
in repository gnunet-fuse.
from cc9aab5 doc: mdocml syntax fixes
new 2fdb467 add mailmap
new 367b41d configure: remove cpp, add uncrustify check.
new b0448da add make pretty.
new fb8cb82 capitalize operating systems.
new 5be2c38 extend bootstrap script for uncrustify
new 2130643 add submodule
new 4173a5c gitignore uncrustify.cfg
new 3639740 fix copy paste mistake.
new 31d078e configure: maybe make fuse detection more portable.
new 8dec151 lint
new a50c548 configure for fuse.
new b264f99 mutex: pthread_np is not widespread on *BSD. FreeBSD points
out that the functions we are using are deprecated and pthread functions should
be used instead. Since we use them for Solaris, move the BSD define to them. We
should instead turn this into an else, as listing N + 1 operating systems
definitions is bad style, for now just see if this is usable. Furthermore
assume that pthread_np exists on Linux - which seems to be unnecessary because
this was previously guarded by BSD.
The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.gitignore | 1 +
.gitmodules | 3 +++
.mailmap | 3 +++
Makefile.am | 12 ++++++++++--
README | 4 ++--
bootstrap | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-
configure.ac | 12 ++++++++++--
contrib/build-common | 1 +
src/fuse/gfs_download.h | 10 +++++-----
src/fuse/gnunet-fuse.h | 42 ++++++++++++++++++++---------------------
src/fuse/mutex.c | 11 ++++-------
src/fuse/mutex.h | 6 +++---
12 files changed, 112 insertions(+), 43 deletions(-)
create mode 100644 .gitmodules
create mode 100644 .mailmap
create mode 160000 contrib/build-common
diff --git a/.gitignore b/.gitignore
index 3764e80..f9cc26e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,4 @@ confdefs.h
confdefs.c
confdefs.err
config.rpath
+uncrustify.cfg
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..75cd679
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "contrib/build-common"]
+ path = contrib/build-common
+ url = http://git.taler.net/build-common.git
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..0e0a5dd
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,3 @@
+address@hidden <address@hidden>
+ng0 <address@hidden> ng0 <address@hidden>
+ng0 <address@hidden> Nils Gillmann <address@hidden>
diff --git a/Makefile.am b/Makefile.am
index 654c21a..b20562a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,15 @@
SUBDIRS = src doc po
-EXTRA_DIST = config.rpath \
- install-sh
+EXTRA_DIST = config.rpath install-sh
ACLOCAL_AMFLAGS = -I m4
+
+if HAVE_UNCRUSTIFY_BINARY
+MCRUSTIFY = find $(top_srcdir) -type f -name '*.c' -or -name '*.h' -print0 |
xargs -0 uncrustify -c $(top_srcdir)/uncrustify.cfg -q --replace --no-backup
2>&1 || true
+else
+MCRUSTIFY = echo "crustify: skipped"
+endif
+
+pretty:
+ $(MCRUSTIFY)
diff --git a/README b/README
index dfc4ed0..719b5b9 100644
--- a/README
+++ b/README
@@ -1,3 +1,3 @@
GNUnet-fuse allows you to mount directories published on GNUnet
-as read-only file-systems (on GNU/Linux and other operating
-systems that support the FUSE API).
+as read-only file-systems (on GNU/Linux and other Operating
+Systems that support the FUSE API).
diff --git a/bootstrap b/bootstrap
index 61009b6..efeb261 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,3 +1,51 @@
#!/bin/sh
-autoreconf -fi
+
+# This is more portable than `which' but comes with
+# the caveat of not(?) properly working on busybox's ash:
+existence()
+{
+ command -v "$1" >/dev/null 2>&1
+}
+
+check_uncrustify()
+{
+ if existence uncrustify; then
+ echo "Installing uncrustify hook and configuration"
+ ln -fs contrib/build-common/conf/uncrustify.cfg uncrustify.cfg 2>
/dev/null
+ ln -fs contrib/build-common/conf/uncrustify_precommit
.git/hooks/pre-commit 2> /dev/null
+ else
+ echo "Uncrustify not detected, hook not installed."
+ echo "Please install uncrustify if you plan on doing development"
+ fi
+}
+
+submodules()
+{
+ # Try to update the submodule. Since bootstrap
+ # is also invoked by distributors, we must
+ # ignore any failing of this function as we
+ # could have no outgoing network connection
+ # in a restricted environment.
+ if ! git --version >/dev/null; then
+ echo "git not installed, skipping submodule update"
+ else
+ git submodule update --init || true
+ git submodule update --recursive --remote || true
+ git submodule sync || true
+ fi
+}
+
+auto_reconf()
+{
+ autoreconf -fi
+}
+
+main()
+{
+ submodules
+ check_uncrustify
+ auto_reconf
+}
+
+main "$@"
diff --git a/configure.ac b/configure.ac
index e4c1a73..ea16b3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,6 @@ AC_PROG_AWK
AC_PROG_CC
AC_PROG_MKDIR_P
-AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -69,6 +68,9 @@ openbsd*)
;;
netbsd*)
build_target="netbsd"
+ # This seems to be required for librefuse, once I manage to make
+ # gnunet-fuse build with it:
+ # CFLAGS="-D_KERNTYPES -D_NETBSD_SOURCE $CFLAGS"
;;
*solaris*)
AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
@@ -112,7 +114,13 @@ backup_LIBS="$LIBS"
backup_CFLAGS="$CFLAGS "
backup_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-D_FILE_OFFSET_BITS=64"
-AC_CHECK_HEADERS([fuse.h],,AC_MSG_ERROR([gnunet-fuse requires fuse.h]))
+
+AC_SEARCH_LIBS([fuse_exit], [fuse refuse], [], [AC_MSG_ERROR([fuse is
required.])])
+
+# uncrustify
+# TODO: maybe add flag to pass location
+AC_CHECK_PROG(UNCRUSTIFY_BINARY, uncrustify, true)
+AM_CONDITIONAL(HAVE_UNCRUSTIFY_BINARY, $UNCRUSTIFY_BINARY)
# test for GNUnet core
gnunet=0
diff --git a/contrib/build-common b/contrib/build-common
new file mode 160000
index 0000000..6ac60bd
--- /dev/null
+++ b/contrib/build-common
@@ -0,0 +1 @@
+Subproject commit 6ac60bd0b1f96324b4175fa03aaf9780ed8efb47
diff --git a/src/fuse/gfs_download.h b/src/fuse/gfs_download.h
index d1d46dc..6a00b55 100644
--- a/src/fuse/gfs_download.h
+++ b/src/fuse/gfs_download.h
@@ -1,17 +1,17 @@
/*
This file is part of gnunet-fuse.
Copyright (C) 2012 GNUnet e.V.
-
+
gnunet-fuse is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
-
+
gnunet-fuse 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 General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -37,7 +37,7 @@
*/
int
GNUNET_FUSE_download_file (struct GNUNET_FUSE_PathInfo *path_info,
- off_t start_offset,
- uint64_t length);
+ off_t start_offset,
+ uint64_t length);
#endif
diff --git a/src/fuse/gnunet-fuse.h b/src/fuse/gnunet-fuse.h
index f321a56..982e02e 100644
--- a/src/fuse/gnunet-fuse.h
+++ b/src/fuse/gnunet-fuse.h
@@ -148,9 +148,9 @@ struct GNUNET_FUSE_PathInfo
*/
struct GNUNET_FUSE_PathInfo *
GNUNET_FUSE_path_info_create (struct GNUNET_FUSE_PathInfo *parent,
- const char *filename,
- const struct GNUNET_FS_Uri *uri,
- int is_directory);
+ const char *filename,
+ const struct GNUNET_FS_Uri *uri,
+ int is_directory);
/**
@@ -163,7 +163,7 @@ GNUNET_FUSE_path_info_create (struct GNUNET_FUSE_PathInfo
*parent,
*/
struct GNUNET_FUSE_PathInfo *
GNUNET_FUSE_path_info_get (const char *path,
- int *eno);
+ int *eno);
/**
@@ -195,39 +195,39 @@ GNUNET_FUSE_path_info_delete (struct GNUNET_FUSE_PathInfo
*pi);
*/
int
GNUNET_FUSE_load_directory (struct GNUNET_FUSE_PathInfo *pi,
- int * eno);
+ int *eno);
/* FUSE function files */
-int gn_getattr(const char *path, struct stat *stbuf);
+int gn_getattr (const char *path, struct stat *stbuf);
-int gn_open(const char *path, struct fuse_file_info *fi);
+int gn_open (const char *path, struct fuse_file_info *fi);
-int gn_read(const char *path, char *buf, size_t size, off_t offset,
- struct fuse_file_info *fi);
+int gn_read (const char *path, char *buf, size_t size, off_t offset,
+ struct fuse_file_info *fi);
-int gn_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
- off_t offset, struct fuse_file_info *fi);
+int gn_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
+ off_t offset, struct fuse_file_info *fi);
-int gn_mknod(const char *path, mode_t mode, dev_t rdev);
+int gn_mknod (const char *path, mode_t mode, dev_t rdev);
-int gn_mkdir(const char *path, mode_t mode);
+int gn_mkdir (const char *path, mode_t mode);
-int gn_unlink(const char *path);
+int gn_unlink (const char *path);
-int gn_rmdir(const char *path);
+int gn_rmdir (const char *path);
-int gn_rename(const char *from, const char *to);
+int gn_rename (const char *from, const char *to);
-int gn_truncate(const char *path, off_t size);
+int gn_truncate (const char *path, off_t size);
-int gn_write(const char *path, const char *buf, size_t size, off_t offset,
- struct fuse_file_info *fi);
+int gn_write (const char *path, const char *buf, size_t size, off_t offset,
+ struct fuse_file_info *fi);
-int gn_release(const char *path, struct fuse_file_info *fi);
+int gn_release (const char *path, struct fuse_file_info *fi);
-int gn_utimens(const char *path, const struct timespec ts[2]);
+int gn_utimens (const char *path, const struct timespec ts[2]);
#endif
diff --git a/src/fuse/mutex.c b/src/fuse/mutex.c
index 24c7036..55078fd 100644
--- a/src/fuse/mutex.c
+++ b/src/fuse/mutex.c
@@ -26,7 +26,7 @@
#include "mutex.h"
#include <pthread.h>
-#if BSD
+#ifdef LINUX
# include <pthread_np.h>
#endif
@@ -73,10 +73,7 @@ GNUNET_mutex_create (int isRecursive)
#if LINUX
GNUNET_assert (0 == pthread_mutexattr_setkind_np
(&attr, PTHREAD_MUTEX_RECURSIVE_NP));
-#elif BSD
- GNUNET_assert (0 == pthread_mutexattr_setkind_np
- (&attr, PTHREAD_MUTEX_RECURSIVE));
-#elif SOLARIS || OSX || WINDOWS
+#elif BSD || SOLARIS || OSX || WINDOWS
GNUNET_assert (0 == pthread_mutexattr_settype
(&attr, PTHREAD_MUTEX_RECURSIVE));
#endif
@@ -110,7 +107,7 @@ GNUNET_mutex_lock (struct GNUNET_Mutex * mutex)
{
if (0 != (errno = pthread_mutex_lock (&mutex->pt)))
{
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pthread_mutex_unlock");
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pthread_mutex_unlock");
GNUNET_assert (0);
}
}
@@ -121,7 +118,7 @@ GNUNET_mutex_unlock (struct GNUNET_Mutex * mutex)
{
if (0 != (errno = pthread_mutex_unlock (&mutex->pt)))
{
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pthread_mutex_unlock");
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pthread_mutex_unlock");
GNUNET_assert (0);
}
}
diff --git a/src/fuse/mutex.h b/src/fuse/mutex.h
index 5381b9d..b007f42 100644
--- a/src/fuse/mutex.h
+++ b/src/fuse/mutex.h
@@ -51,15 +51,15 @@ struct GNUNET_Mutex *
GNUNET_mutex_create (int isRecursive);
-void
+void
GNUNET_mutex_destroy (struct GNUNET_Mutex *mutex);
-void
+void
GNUNET_mutex_lock (struct GNUNET_Mutex *mutex);
-void
+void
GNUNET_mutex_unlock (struct GNUNET_Mutex *mutex);
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet-fuse] branch master updated (cc9aab5 -> b264f99),
gnunet <=
- [gnunet-fuse] 01/12: add mailmap, gnunet, 2019/11/19
- [gnunet-fuse] 04/12: capitalize operating systems., gnunet, 2019/11/19
- [gnunet-fuse] 05/12: extend bootstrap script for uncrustify, gnunet, 2019/11/19
- [gnunet-fuse] 02/12: configure: remove cpp, add uncrustify check., gnunet, 2019/11/19
- [gnunet-fuse] 08/12: fix copy paste mistake., gnunet, 2019/11/19
- [gnunet-fuse] 03/12: add make pretty., gnunet, 2019/11/19
- [gnunet-fuse] 07/12: gitignore uncrustify.cfg, gnunet, 2019/11/19
- [gnunet-fuse] 06/12: add submodule, gnunet, 2019/11/19
- [gnunet-fuse] 09/12: configure: maybe make fuse detection more portable., gnunet, 2019/11/19
- [gnunet-fuse] 11/12: configure for fuse., gnunet, 2019/11/19