aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2016-03-15 17:01:33 +0000
committerMark Felder <feld@FreeBSD.org>2016-03-15 17:01:33 +0000
commit12e2158f6f70874dd9997fb484c0716034df8260 (patch)
tree42513bcc5a70300493b83e0e0f4a89e980e07306
parentd381dd7c099e71a368321349f0ec6fdd83254496 (diff)
downloadports-12e2158f6f70874dd9997fb484c0716034df8260.tar.gz
ports-12e2158f6f70874dd9997fb484c0716034df8260.zip
MFH: r411192
sysutils/inotify-tools: Update to 3.14.01 This update prevents signal handling from being blocked on a worker thread as well as an accumulation of other bug fixes. PR: 204366 Approved by: ports-secteam (with hat)
Notes
Notes: svn path=/branches/2016Q1/; revision=411193
-rw-r--r--sysutils/inotify-tools/Makefile6
-rw-r--r--sysutils/inotify-tools/distinfo4
-rw-r--r--sysutils/inotify-tools/files/patch-configure.ac18
-rw-r--r--sysutils/inotify-tools/files/patch-libinotifytools_src_inotifytools.c31
-rw-r--r--sysutils/inotify-tools/files/patch-src_Makefile.am16
-rw-r--r--sysutils/inotify-tools/files/patch-src_inotifywatch.c50
6 files changed, 89 insertions, 36 deletions
diff --git a/sysutils/inotify-tools/Makefile b/sysutils/inotify-tools/Makefile
index a9129fcac013..49a822a9399c 100644
--- a/sysutils/inotify-tools/Makefile
+++ b/sysutils/inotify-tools/Makefile
@@ -2,9 +2,9 @@
# $FreeBSD$
PORTNAME= inotify-tools
-PORTVERSION= 3.14
-CATEGORIES= sysutils
+PORTVERSION= 3.14.01
DISTVERSIONPREFIX= v
+CATEGORIES= sysutils
MAINTAINER= yuri@rawbw.com
COMMENT= Command-line utilities to watch for file events
@@ -15,6 +15,7 @@ LIB_DEPENDS= libinotify.so:${PORTSDIR}/devel/libinotify
USE_GITHUB= yes
GH_ACCOUNT= rvoicilas
+GH_TAGNAME= 1df9af4
USES= autoreconf gmake libtool
GNU_CONFIGURE= yes
@@ -24,6 +25,5 @@ INSTALL_TARGET= install-strip
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
-LIBS+= -linotify
.include <bsd.port.mk>
diff --git a/sysutils/inotify-tools/distinfo b/sysutils/inotify-tools/distinfo
index a380059bceda..47c026ae9a5c 100644
--- a/sysutils/inotify-tools/distinfo
+++ b/sysutils/inotify-tools/distinfo
@@ -1,2 +1,2 @@
-SHA256 (rvoicilas-inotify-tools-v3.14_GH0.tar.gz) = 97a4fdf9132da47c2baa677c1a427c435ee55a26df42b2b74a41489b9fbd2323
-SIZE (rvoicilas-inotify-tools-v3.14_GH0.tar.gz) = 66905
+SHA256 (rvoicilas-inotify-tools-v3.14.01-1df9af4_GH0.tar.gz) = 3cb567344dad1fbe9a935d5a7c3f9c9bbce151df982631eb319763b2708ef4ea
+SIZE (rvoicilas-inotify-tools-v3.14.01-1df9af4_GH0.tar.gz) = 70023
diff --git a/sysutils/inotify-tools/files/patch-configure.ac b/sysutils/inotify-tools/files/patch-configure.ac
new file mode 100644
index 000000000000..beecd0234aa2
--- /dev/null
+++ b/sysutils/inotify-tools/files/patch-configure.ac
@@ -0,0 +1,18 @@
+--- configure.ac.orig 2014-11-09 20:57:04 UTC
++++ configure.ac
+@@ -44,6 +44,7 @@ AM_CONDITIONAL([STATIC_BINARY_ENABLE], t
+
+
+ # Checks for libraries.
++AC_SEARCH_LIBS(inotify_init, inotify)
+
+ # Checks for header files.
+ AC_CHECK_HEADERS([sys/inotify.h mcheck.h])
+@@ -62,6 +63,7 @@ AC_C_CONST
+ AC_C_INLINE
+
+ # Checks for library functions.
++AC_CHECK_FUNCS(stat64, [], [CPPFLAGS="$CPPFLAGS -Dstat64=stat -Dlstat64=lstat"])
+
+ # Set variables used in man page templates
+ MAN_DATE=$(date +'%B %d, %Y')
diff --git a/sysutils/inotify-tools/files/patch-libinotifytools_src_inotifytools.c b/sysutils/inotify-tools/files/patch-libinotifytools_src_inotifytools.c
deleted file mode 100644
index a3b3f2639035..000000000000
--- a/sysutils/inotify-tools/files/patch-libinotifytools_src_inotifytools.c
+++ /dev/null
@@ -1,31 +0,0 @@
---- libinotifytools/src/inotifytools.c.orig 2010-02-02 14:55:19 UTC
-+++ libinotifytools/src/inotifytools.c
-@@ -1309,14 +1309,14 @@ int inotifytools_watch_recursively_with_
-
- static struct dirent * ent;
- char * next_file;
-- static struct stat64 my_stat;
-+ static struct stat my_stat;
- ent = readdir( dir );
- // Watch each directory within this directory
- while ( ent ) {
- if ( (0 != strcmp( ent->d_name, "." )) &&
- (0 != strcmp( ent->d_name, ".." )) ) {
- nasprintf(&next_file,"%s%s", my_path, ent->d_name);
-- if ( -1 == lstat64( next_file, &my_stat ) ) {
-+ if ( -1 == lstat( next_file, &my_stat ) ) {
- error = errno;
- free( next_file );
- if ( errno != EACCES ) {
-@@ -1595,9 +1595,9 @@ int inotifytools_error() {
- * @internal
- */
- int isdir( char const * path ) {
-- static struct stat64 my_stat;
-+ static struct stat my_stat;
-
-- if ( -1 == lstat64( path, &my_stat ) ) {
-+ if ( -1 == lstat( path, &my_stat ) ) {
- if (errno == ENOENT) return 0;
- fprintf(stderr, "Stat failed on %s: %s\n", path, strerror(errno));
- return 0;
diff --git a/sysutils/inotify-tools/files/patch-src_Makefile.am b/sysutils/inotify-tools/files/patch-src_Makefile.am
new file mode 100644
index 000000000000..50da9fa71b6b
--- /dev/null
+++ b/sysutils/inotify-tools/files/patch-src_Makefile.am
@@ -0,0 +1,16 @@
+--- src/Makefile.am.orig 2014-11-09 20:57:04 UTC
++++ src/Makefile.am
+@@ -2,10 +2,11 @@ bin_PROGRAMS = inotifywait inotifywatch
+ inotifywait_SOURCES = inotifywait.c common.c common.h
+ inotifywatch_SOURCES = inotifywatch.c common.c common.h
+
+-AM_CFLAGS = -Wall -Werror -Wpointer-arith -std=c99 -I../libinotifytools/src -L../libinotifytools/src
++AM_CFLAGS = -Wall -Werror -Wpointer-arith -std=c99
+ AM_CPPFLAGS = -I$(top_srcdir)/libinotifytools/src
+ LDADD = ../libinotifytools/src/libinotifytools.la
++AM_LDFLAGS = -L$(top_srcdir)/libinotifytools/src
+
+ if STATIC_BINARY_ENABLE
+-AM_LDFLAGS = -static-libtool-libs
++AM_LDFLAGS += -static-libtool-libs
+ endif
diff --git a/sysutils/inotify-tools/files/patch-src_inotifywatch.c b/sysutils/inotify-tools/files/patch-src_inotifywatch.c
new file mode 100644
index 000000000000..85556d5e1f44
--- /dev/null
+++ b/sysutils/inotify-tools/files/patch-src_inotifywatch.c
@@ -0,0 +1,50 @@
+--- src/inotifywatch.c.orig 2015-11-09 01:40:46 UTC
++++ src/inotifywatch.c
+@@ -12,6 +12,9 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <getopt.h>
++#ifdef __FreeBSD__
++#include <pthread.h>
++#endif // __FreeBSD__
+ #include <regex.h>
+ #include <signal.h>
+ #include <stdbool.h>
+@@ -93,6 +96,9 @@ int main(int argc, char ** argv)
+ char * exc_iregex = NULL;
+ char * inc_regex = NULL;
+ char * inc_iregex = NULL;
++#ifdef __FreeBSD__
++ sigset_t set, oset;
++#endif // __FreeBSD__
+
+ signal( SIGINT, handle_impatient_user );
+
+@@ -121,11 +127,27 @@ int main(int argc, char ** argv)
+ return EXIT_FAILURE;
+ }
+
++#ifdef __FreeBSD__
++ // Block some signals in libinotify's worker thread, so that
++ // handle_signal runs in the context of the main thread and
++ // the 'done' flag is actually honored.
++ sigemptyset(&set);
++ sigaddset(&set, SIGINT);
++ sigaddset(&set, SIGHUP);
++ sigaddset(&set, SIGTERM);
++ sigaddset(&set, SIGALRM);
++ pthread_sigmask(SIG_BLOCK, &set, &oset);
++#endif // __FreeBSD__
++
+ if ( !inotifytools_initialize() ) {
+ warn_inotify_init_error();
+ return EXIT_FAILURE;
+ }
+
++#ifdef __FreeBSD__
++ pthread_sigmask(SIG_SETMASK, &oset, NULL);
++#endif // __FreeBSD__
++
+ // Attempt to watch file
+ // If events is still 0, make it all events.
+ if ( !events )