From 1ada503074e43848ec0d2faa6647e43c66085884 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Thu, 2 Dec 2010 11:57:04 +0000 Subject: [PATCH] release 2.0.0 --- Makefile.am | 13 +++--- configure.ac | 52 ++++++++++++---------- doc/lsyncd.1.txt | 4 +- fsevents.c | 2 + lsyncd.c | 1 - lsyncd.lua | 112 +++++++++++++++++++++++------------------------ 6 files changed, 94 insertions(+), 90 deletions(-) diff --git a/Makefile.am b/Makefile.am index f17071f..8ab6a4b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,16 +2,16 @@ AUTOMAKE_OPTIONS = foreign CFLAGS += -Wall $(LUA_CFLAGS) bin_PROGRAMS = lsyncd lsyncd_SOURCES = lsyncd.h lsyncd.c lsyncd.lua -if INOTIFY +#if INOTIFY lsyncd_SOURCES += inotify.c -endif +#endif #if FANOTIFY #lsyncd_SOURCES += fanotify.c #endif -if FSEVENTS -lsyncd_SOURCES += fsevents.c -endif +#if FSEVENTS +#lsyncd_SOURCES += fsevents.c +#endif lsyncd_LDADD = $(LUA_LIBS) exampledir = $(datarootdir)/doc/@PACKAGE@ @@ -24,7 +24,8 @@ dist_example_DATA = \ examples/lrsyncssh.lua TESTS = tests/l4-rsync-data.sh -man1_MANS = doc/lsyncd.1 +dist_man1_MANS = doc/lsyncd.1 +EXTRA_DIST = doc/lsyncd.1.txt doc/lsyncd.1.xml doc/lsyncd.1: doc/lsyncd.1.xml xsltproc -o $@ -nonet /etc/asciidoc/docbook-xsl/manpage.xsl $< diff --git a/configure.ac b/configure.ac index 56bbeb6..2435926 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ echo XXXXXXXXX # Process this file with autoconf to produce a configure script. #AC_PREREQ(2.60) -AC_INIT(lsyncd, 2.0beta3, axkibe@gmail.com) +AC_INIT(lsyncd, 2.0.0, axkibe@gmail.com) AC_CONFIG_SRCDIR([lsyncd.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) @@ -37,20 +37,24 @@ if test "x${with_runner}" != x; then fi AM_CONDITIONAL([RUNNER], [test x${with_runner} != x]) -### -# --without-inotify option -AC_ARG_WITH([inotify], -[ --without-inotify Do not use Linux inotify event interface. On by default.]) -if test "x${with_inotify}" == xno; then - echo "compiling without inotify" -else +## NOTE: +## With this release Lsyncd can yet only do with inotify. +## enabling fsevents and disabling inotify is thus commented out. + +#### +## --without-inotify option +#AC_ARG_WITH([inotify], +#[ --without-inotify Do not use Linux inotify event interface. On by default.]) +#if test "x${with_inotify}" == xno; then +# echo "compiling without inotify" +#else echo "compiling with inotify" AC_DEFINE(LSYNCD_WITH_INOTIFY,,"descr") -fi +#fi AM_CONDITIONAL([INOTIFY], [test x${with_inotify} != xno]) -### -# --with-fanotify option +#### +## --with-fanotify option ## #AC_ARG_WITH([fanotify], #[ --with-fanotify Uses Linux new fanotify event interface. EXPERIMENTAL! @@ -61,20 +65,20 @@ AM_CONDITIONAL([INOTIFY], [test x${with_inotify} != xno]) # echo "compiling with fanotify - WARNING experimental!" # AC_DEFINE(LSYNCD_WITH_FANOTIFY,,"descr") ##fi -#AM_CONDITIONAL([FANOTIFY], -# [test x${with_fanotify} != x -a x${with_fanotify} != xno]) +AM_CONDITIONAL([FANOTIFY], + [test x${with_fanotify} != x -a x${with_fanotify} != xno]) -### -# --with-fsevents -AC_ARG_WITH([fsevents], -[ --with-fsevents Uses MacOS (10.5) /dev/fsevents. EXPERIMENTAL! - Off by default.]) -if test "x${with_fsevents}" != x; then - echo "compiling with fsevents. WARNING experimental!" - AC_DEFINE(LSYNCD_WITH_FSEVENTS,,"descr") -else - echo "compiling without fsevents" -fi +#### +## --with-fsevents +#AC_ARG_WITH([fsevents], +#[ --with-fsevents Uses MacOS (10.5) /dev/fsevents. EXPERIMENTAL! +# Off by default.]) +#if test "x${with_fsevents}" != x; then +# echo "compiling with fsevents. WARNING experimental!" +# AC_DEFINE(LSYNCD_WITH_FSEVENTS,,"descr") +#else +# echo "compiling without fsevents" +#fi AM_CONDITIONAL([FSEVENTS], [test x${with_fsevents} != x -a xno${with_fsevents} != xno]) diff --git a/doc/lsyncd.1.txt b/doc/lsyncd.1.txt index f221449..300f2ad 100644 --- a/doc/lsyncd.1.txt +++ b/doc/lsyncd.1.txt @@ -3,7 +3,7 @@ lsyncd(1) :doctype: manpage :man source: Lsyncd :man manual: Lsyncd -:man version: 2.0 +:man version: 2.0.0 :date: December 2010 NAME @@ -84,7 +84,7 @@ Online Manual: http://code.google.com/p/lsyncd/wiki/Lsyncd2 VERSION ------ -This man page is in development (TODOX) for lsyncd(1) version 2.0 +This man page is for lsyncd(1) version 2.0.0 AUTHOR ------ diff --git a/fsevents.c b/fsevents.c index 9455670..434c444 100644 --- a/fsevents.c +++ b/fsevents.c @@ -26,6 +26,8 @@ * volume to determine "what changed". */ +#error "This code is not yet finished." + #include "lsyncd.h" #include diff --git a/lsyncd.c b/lsyncd.c index b1541ad..990aeac 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -541,7 +541,6 @@ observe_fd(int fd, observances[pos].extra = extra; return; } -printf("new observance %d:%d\n", fd, pos); if (observance_action) { // TODO diff --git a/lsyncd.lua b/lsyncd.lua index 417b343..da24a18 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -20,7 +20,7 @@ if lsyncd_version then "You cannot use the lsyncd runner as configuration file!") lsyncd.terminate(-1) -- ERRNO end -lsyncd_version = "2.0beta3" +lsyncd_version = "2.0.0" ----- -- Hides the core interface from user scripts @@ -281,7 +281,7 @@ local Combiner = (function() end ----- - -- TODO + -- Table how to combine events that dont involve a move. -- local combineNoMove = { Attrib = {Attrib=abso, Modify=repl, Create=repl, Delete=repl }, @@ -733,7 +733,7 @@ local InletFactory = (function() end ----- - -- TODO + -- The functions the inlet provides. -- local inletFuncs = { ----- @@ -1358,7 +1358,6 @@ local Sync = (function() local st = vd.status f:write(st, string.sub(spaces, 1, 7 - #st)) f:write(vd.etype," ") - -- TODO spaces f:write(vd.path) if (vd.path2) then f:write(" -> ",vd.path2) @@ -1821,61 +1820,60 @@ local Inotify = (function() } end)() ------ --- Interface to OSX /dev/fsevents, watches the whole filesystems +------ +---- Interface to OSX /dev/fsevents, watches the whole filesystems +---- +---- All fsevents specific implementation should be enclosed here. +---- +--local Fsevents = (function() +-- ----- +-- -- A list indexed by sync's containing the root path this +-- -- sync is interested in. +-- -- +-- local syncPaths = {} -- --- All fsevents specific implementation should be enclosed here. +-- ----- +-- -- adds a Sync to receive events +-- -- +-- -- @param sync Object to receive events +-- -- @param dir dir to watch +-- -- +-- local function addSync(sync, dir) +-- if syncRoots[sync] then +-- error("duplicate sync in Fanotify.addSync()") +-- end +-- -- TODO for non subdirs adddir only +-- syncRoots[sync] = dir +-- end -- -local Fsevents = (function() - ----- - -- A list indexed by sync's containing the root path this - -- sync is interested in. - -- - local syncPaths = {} - - ----- - -- adds a Sync to receive events - -- - -- @param sync Object to receive events - -- @param dir dir to watch - -- - local function addSync(sync, dir) - if syncRoots[sync] then - error("duplicate sync in Fanotify.addSync()") - end - -- TODO for non subdirs adddir only - lsyncd.fanotify.watchfs(dir) - syncRoots[sync] = dir - end - - ----- - -- Called when any event has occured. - -- - -- @param etype "Attrib", "Mofify", "Create", "Delete", "Move") - -- @param wd watch descriptor (matches lsyncd.inotifyadd()) - -- @param isdir true if filename is a directory - -- @param time time of event - -- @param filename string filename without path - -- @param filename2 - -- - local function event(etype, isdir, time, filename, filename2) - print("FSEVENTS", etype, isdir, time, filename, filename2) - end - - ----- - -- Writes a status report about inotifies to a filedescriptor - -- - local function statusReport(f) - -- TODO - end - - -- public interface - return { - addSync = addSync, - event = event, - statusReport = statusReport - } -end)() +-- ----- +-- -- Called when any event has occured. +-- -- +-- -- @param etype "Attrib", "Mofify", "Create", "Delete", "Move") +-- -- @param wd watch descriptor (matches lsyncd.inotifyadd()) +-- -- @param isdir true if filename is a directory +-- -- @param time time of event +-- -- @param filename string filename without path +-- -- @param filename2 +-- -- +-- local function event(etype, isdir, time, filename, filename2) +-- log("Fsevents", etype, isdir, time, filename, filename2) +-- end +-- +-- ----- +-- -- Writes a status report about inotifies to a filedescriptor +-- -- +-- local function statusReport(f) +-- -- TODO +-- end +-- +-- -- public interface +-- return { +-- addSync = addSync, +-- event = event, +-- statusReport = statusReport +-- } +--end)() ----- -- Holds information about the event monitor capabilities