aboutsummaryrefslogtreecommitdiff
path: root/sysutils/fileschanged
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2007-06-04 22:29:29 +0000
committerPav Lucistnik <pav@FreeBSD.org>2007-06-04 22:29:29 +0000
commit2a1722100b03067ae774395768c0c16ce37d8308 (patch)
tree3017d35b26a342938e5740cbf05a930211980e4f /sysutils/fileschanged
parentaaf911d26d5f1849068c67d1e1f129243ae1fd49 (diff)
downloadports-2a1722100b03067ae774395768c0c16ce37d8308.tar.gz
ports-2a1722100b03067ae774395768c0c16ce37d8308.zip
Notes
Diffstat (limited to 'sysutils/fileschanged')
-rw-r--r--sysutils/fileschanged/Makefile14
-rw-r--r--sysutils/fileschanged/distinfo6
-rw-r--r--sysutils/fileschanged/files/patch-filelist.c32
-rw-r--r--sysutils/fileschanged/files/patch-fileschanged.c21
-rw-r--r--sysutils/fileschanged/files/patch-handlers.c28
-rw-r--r--sysutils/fileschanged/files/patch-opts.c28
-rw-r--r--sysutils/fileschanged/files/patch-opts.h10
-rw-r--r--sysutils/fileschanged/files/patch-wl.c96
-rw-r--r--sysutils/fileschanged/pkg-message9
9 files changed, 149 insertions, 95 deletions
diff --git a/sysutils/fileschanged/Makefile b/sysutils/fileschanged/Makefile
index 8a5843d2e2c1..5713492a3103 100644
--- a/sysutils/fileschanged/Makefile
+++ b/sysutils/fileschanged/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= fileschanged
-PORTVERSION= 0.6.0
-PORTREVISION= 1
+PORTVERSION= 0.6.5
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -21,20 +20,13 @@ BUILD_DEPENDS= ${LOCALBASE}/include/argp.h:${PORTSDIR}/devel/argp-standalone \
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_FAM= yes
-WANT_FAM_SYSTEM=fam
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" \
LIBS="-largp"
-CONFIGURE_ARGS+=--datadir=${PREFIX}/share/doc
+CONFIGURE_ARGS= --datadir=${PREFIX}/share/doc --disable-nls
INFO= fileschanged
MAN1= fileschanged.1
-PORTDOCS= AUTHORS COPYING ChangeLog INSTALL NEWS README fileschanged.lsm
+PORTDOCS= AUTHORS ChangeLog INSTALL NEWS README
PLIST_FILES= bin/fileschanged
-post-patch:
- ${REINPLACE_CMD} -e "s,-Werror,," ${WRKSRC}/src/Makefile.in
-
-post-install:
- @${CAT} ${PKGMESSAGE}
-
.include <bsd.port.mk>
diff --git a/sysutils/fileschanged/distinfo b/sysutils/fileschanged/distinfo
index 90c452098a2b..63dc51bb6f2d 100644
--- a/sysutils/fileschanged/distinfo
+++ b/sysutils/fileschanged/distinfo
@@ -1,3 +1,3 @@
-MD5 (fileschanged-0.6.0.tar.gz) = 78f652c17190017080eb985804d62013
-SHA256 (fileschanged-0.6.0.tar.gz) = fe9039b7fd113f41a5abc5873317c369efbf583388cbf74ae5dbade883eb071b
-SIZE (fileschanged-0.6.0.tar.gz) = 188377
+MD5 (fileschanged-0.6.5.tar.gz) = 49ae8bed507c000f9c7fa430b5b71205
+SHA256 (fileschanged-0.6.5.tar.gz) = 63c10995197bca6a7f24a19ca26870abafc919b23a870447cb44199d22f777cc
+SIZE (fileschanged-0.6.5.tar.gz) = 270182
diff --git a/sysutils/fileschanged/files/patch-filelist.c b/sysutils/fileschanged/files/patch-filelist.c
index 22f662c13bb6..ca89793ecaf5 100644
--- a/sysutils/fileschanged/files/patch-filelist.c
+++ b/sysutils/fileschanged/files/patch-filelist.c
@@ -1,9 +1,17 @@
---- src/filelist.c.orig Mon Feb 23 02:17:30 2004
-+++ src/filelist.c Wed May 19 18:30:04 2004
-@@ -12,6 +12,30 @@
- #include "opts.h"
+--- src/filelist.c.orig Wed Apr 19 21:42:28 2006
++++ src/filelist.c Mon Jun 4 21:31:54 2007
+@@ -4,7 +4,6 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <error.h>
+ #include "gettext.h"
+ #include <libgen.h>
+ #include <unistd.h>
+@@ -16,6 +15,31 @@
#include "listdirs.h"
extern struct arguments_t arguments;
+
+#if defined(__FreeBSD__)
+ssize_t getline(char **lineptr, size_t *n, FILE *stream)
+{
@@ -28,6 +36,16 @@
+ return len;
+}
+#endif
- int for_every_filename(int (*for_every_file)(int (*)(void *, char *), void *list), int (*add_it_to_the)(void *list, char *filename), void *list)
- {
- for_every_file(add_it_to_the, list);
++
+ /*
+ * filelist.c:
+ * int filelist_populate (void *list_of_files_to_monitor);
+@@ -74,7 +98,7 @@
+ {
+ fileptr = fopen (filename, "r");
+ if (!fileptr)
+- error(1, 0, _("Error: couldn't open '%s'\n"), filename);
++ fprintf(stderr, _("Error: couldn't open '%s'\n"), filename);
+ }
+ while (getline (&line, &n, fileptr) > 0)
+ {
diff --git a/sysutils/fileschanged/files/patch-fileschanged.c b/sysutils/fileschanged/files/patch-fileschanged.c
new file mode 100644
index 000000000000..a1308955d146
--- /dev/null
+++ b/sysutils/fileschanged/files/patch-fileschanged.c
@@ -0,0 +1,21 @@
+--- src/fileschanged.c.orig Wed Apr 19 21:42:28 2006
++++ src/fileschanged.c Mon Jun 4 21:30:49 2007
+@@ -3,7 +3,6 @@
+ #include <signal.h>
+ #include <fam.h>
+ #include <errno.h>
+-#include <error.h>
+ #include "config.h"
+ #include "gettext.h"
+ #include "fileschanged.h"
+@@ -15,6 +14,10 @@
+ #include "handlers.h"
+ extern struct arguments_t arguments;
+ struct fileschanged_appstate_t app;
++
++static void error (int status, int errnum, const char *format) {
++ fprintf(stderr, "%s\n", format);
++}
+
+ static void
+ show_changed_file (char *filename, struct stat *statbuf)
diff --git a/sysutils/fileschanged/files/patch-handlers.c b/sysutils/fileschanged/files/patch-handlers.c
index 2903833803b8..967350d8e76f 100644
--- a/sysutils/fileschanged/files/patch-handlers.c
+++ b/sysutils/fileschanged/files/patch-handlers.c
@@ -1,39 +1,13 @@
--- src/handlers.c.orig Mon Feb 23 01:42:46 2004
+++ src/handlers.c Wed Jun 16 20:13:06 2004
-@@ -7,6 +7,11 @@
+@@ -7,6 +7,10 @@
#include "node.h"
#include "opts.h"
#include "wl.h"
+#if defined(__FreeBSD__)
-+#include <signal.h>
+#include "libgen.h"
+#endif
+
extern struct arguments_t arguments;
struct handler_t handlers[FC_HANDLER_MAX]=
{
-@@ -180,12 +185,24 @@
- }
- void show_event(enum handler_enum_t id, char *filename)
- {
-+ struct sigaction sa;
-+
-+ if (arguments.fileschanged.exec_command == NULL) {
- if (arguments.fileschanged.showaction)
- {
- fprintf(stdout, "%s ", handlers[id].name);
- }
- fprintf(stdout, "%s\n",filename);
- fflush(stdout);
-+ } else {
-+ sa.sa_handler = SIG_IGN;
-+ sa.sa_flags = SA_NOCLDWAIT;
-+ sigemptyset(&sa.sa_mask);
-+ sigaction(SIGCHLD, &sa, NULL);
-+ if (!fork()) {
-+ execlp(arguments.fileschanged.exec_command, arguments.fileschanged.exec_command, handlers[id].name, filename, NULL);
-+ }
-+ }
- return;
- }
- int handle_created_file(FAMConnection *c, void *list, enum handler_enum_t id, char *filename)
diff --git a/sysutils/fileschanged/files/patch-opts.c b/sysutils/fileschanged/files/patch-opts.c
deleted file mode 100644
index f2ee24633b09..000000000000
--- a/sysutils/fileschanged/files/patch-opts.c
+++ /dev/null
@@ -1,28 +0,0 @@
---- src/opts.c.orig Mon Feb 23 01:17:30 2004
-+++ src/opts.c Sun May 23 17:52:10 2004
-@@ -19,6 +19,7 @@
- const char filelist_option_explanation[]="Monitor the list of filenames inside FILE";
- const char filechangetimeout_option_explanation[]="Delay showing changed files for N seconds (Def=2)";
- const char showaction_option_explanation[]="Also display action when displaying altered files";
-+const char execcmd_option_explanation[]="Execute COMMAND when file altered (COMMAND action filename)";
-
- struct arguments_t arguments;
- static struct argp_option options[] =
-@@ -34,6 +35,7 @@
- {"filelist", 'l',"FILENAME",0, filelist_option_explanation, 3},
- {"timeout", 't',"N",0, filechangetimeout_option_explanation, 4},
- {"prepend-action", 'p',0,0, showaction_option_explanation, 5},
-+ {"execcmd", 'x',"COMMAND",0, execcmd_option_explanation, 6},
- { 0 }
- };
-
-@@ -93,6 +95,9 @@
- arguments->fileschanged.filechangetimeout=atoi(arg);
- if (arguments->fileschanged.filechangetimeout<=1)
- arguments->fileschanged.filechangetimeout=-1;
-+ break;
-+ case 'x':
-+ arguments->fileschanged.exec_command=strdup(arg);
- break;
- case ARGP_KEY_INIT:
- free_arguments();
diff --git a/sysutils/fileschanged/files/patch-opts.h b/sysutils/fileschanged/files/patch-opts.h
deleted file mode 100644
index 7daaf7d5fe20..000000000000
--- a/sysutils/fileschanged/files/patch-opts.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/opts.h.orig Mon Feb 23 01:17:30 2004
-+++ src/opts.h Sun May 23 17:53:00 2004
-@@ -17,6 +17,7 @@
- int filestomonitor;
- int filechangetimeout;
- int showaction;
-+ char *exec_command;
- };
- struct arguments_t {
- char **args;
diff --git a/sysutils/fileschanged/files/patch-wl.c b/sysutils/fileschanged/files/patch-wl.c
new file mode 100644
index 000000000000..d3828865f381
--- /dev/null
+++ b/sysutils/fileschanged/files/patch-wl.c
@@ -0,0 +1,96 @@
+--- src/wl.c.orig Wed Apr 19 21:42:30 2006
++++ src/wl.c Mon Jun 4 21:49:40 2007
+@@ -4,12 +4,92 @@
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <time.h>
+-#include <argz.h>
++#include <assert.h>
++#include <errno.h>
+ #include "wl.h"
+ #include "opts.h"
+ int wl_index = 0;
+ char*wl = NULL;
+ size_t wl_max = 0;
++
++// -------------------- XXX ---------------------
++
++static char *
++argz_next (argz, argz_len, entry)
++ char *argz;
++ size_t argz_len;
++ const char *entry;
++{
++ assert ((argz && argz_len) || (!argz && !argz_len));
++
++ if (entry)
++ {
++ /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address
++ within the ARGZ vector. */
++ assert ((!argz && !argz_len)
++ || ((argz <= entry) && (entry < (argz + argz_len))));
++
++ /* Move to the char immediately after the terminating
++ '\0' of ENTRY. */
++ entry = 1+ strchr (entry, '\0');
++
++ /* Return either the new ENTRY, or else NULL if ARGZ is
++ exhausted. */
++ return (entry >= argz + argz_len) ? 0 : (char *) entry;
++ }
++ else
++ {
++ /* This should probably be flagged as a programmer error,
++ since starting an argz_next loop with the iterator set
++ to ARGZ is safer. To preserve semantics, handle the NULL
++ case by returning the start of ARGZ (if any). */
++ if (argz_len > 0)
++ return argz;
++ else
++ return 0;
++ }
++}
++
++static int
++argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len)
++{
++ size_t new_argz_len = *argz_len + buf_len;
++ char *new_argz = realloc (*argz, new_argz_len);
++ if (new_argz)
++ {
++ memcpy (new_argz + *argz_len, buf, buf_len);
++ *argz = new_argz;
++ *argz_len = new_argz_len;
++ return 0;
++ }
++ else
++ return ENOMEM;
++}
++
++static int
++argz_add (char **argz, size_t *argz_len, const char *str)
++{
++ return argz_append (argz, argz_len, str, strlen (str) + 1);
++}
++
++static void
++argz_delete (char **argz, size_t *argz_len, char *entry)
++{
++ if (entry)
++ /* Get rid of the old value for NAME. */
++ {
++ size_t entry_len = strlen (entry) + 1;
++ *argz_len -= entry_len;
++ memmove (entry, entry + entry_len, *argz_len - (entry - *argz));
++ if (*argz_len == 0)
++ {
++ free (*argz);
++ *argz = 0;
++ }
++ }
++}
++
++// -------------------- XXX ---------------------
+
+ void
+ wl_init ()
diff --git a/sysutils/fileschanged/pkg-message b/sysutils/fileschanged/pkg-message
deleted file mode 100644
index 3175f7d6a8b1..000000000000
--- a/sysutils/fileschanged/pkg-message
+++ /dev/null
@@ -1,9 +0,0 @@
-************************************************************************
-
- For correct work of FILESCHANGED, you must configure File Alteration
- Monitor (/usr/ports/devel/fam)
-
- Read /usr/ports/devel/fam/pkg-message or run:
- pkg_info -Dx fam | more
-
-************************************************************************