mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-07 17:14:03 +00:00
release 2.0.0
This commit is contained in:
parent
ea9e8498e0
commit
1ada503074
13
Makefile.am
13
Makefile.am
@ -2,16 +2,16 @@ AUTOMAKE_OPTIONS = foreign
|
|||||||
CFLAGS += -Wall $(LUA_CFLAGS)
|
CFLAGS += -Wall $(LUA_CFLAGS)
|
||||||
bin_PROGRAMS = lsyncd
|
bin_PROGRAMS = lsyncd
|
||||||
lsyncd_SOURCES = lsyncd.h lsyncd.c lsyncd.lua
|
lsyncd_SOURCES = lsyncd.h lsyncd.c lsyncd.lua
|
||||||
if INOTIFY
|
#if INOTIFY
|
||||||
lsyncd_SOURCES += inotify.c
|
lsyncd_SOURCES += inotify.c
|
||||||
endif
|
#endif
|
||||||
#if FANOTIFY
|
#if FANOTIFY
|
||||||
#lsyncd_SOURCES += fanotify.c
|
#lsyncd_SOURCES += fanotify.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if FSEVENTS
|
#if FSEVENTS
|
||||||
lsyncd_SOURCES += fsevents.c
|
#lsyncd_SOURCES += fsevents.c
|
||||||
endif
|
#endif
|
||||||
|
|
||||||
lsyncd_LDADD = $(LUA_LIBS)
|
lsyncd_LDADD = $(LUA_LIBS)
|
||||||
exampledir = $(datarootdir)/doc/@PACKAGE@
|
exampledir = $(datarootdir)/doc/@PACKAGE@
|
||||||
@ -24,7 +24,8 @@ dist_example_DATA = \
|
|||||||
examples/lrsyncssh.lua
|
examples/lrsyncssh.lua
|
||||||
TESTS = tests/l4-rsync-data.sh
|
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
|
doc/lsyncd.1: doc/lsyncd.1.xml
|
||||||
xsltproc -o $@ -nonet /etc/asciidoc/docbook-xsl/manpage.xsl $<
|
xsltproc -o $@ -nonet /etc/asciidoc/docbook-xsl/manpage.xsl $<
|
||||||
|
52
configure.ac
52
configure.ac
@ -2,7 +2,7 @@
|
|||||||
echo XXXXXXXXX
|
echo XXXXXXXXX
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#AC_PREREQ(2.60)
|
#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_SRCDIR([lsyncd.c])
|
||||||
AC_CONFIG_HEADER([config.h])
|
AC_CONFIG_HEADER([config.h])
|
||||||
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
|
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
|
||||||
@ -37,20 +37,24 @@ if test "x${with_runner}" != x; then
|
|||||||
fi
|
fi
|
||||||
AM_CONDITIONAL([RUNNER], [test x${with_runner} != x])
|
AM_CONDITIONAL([RUNNER], [test x${with_runner} != x])
|
||||||
|
|
||||||
###
|
## NOTE:
|
||||||
# --without-inotify option
|
## With this release Lsyncd can yet only do with inotify.
|
||||||
AC_ARG_WITH([inotify],
|
## enabling fsevents and disabling inotify is thus commented out.
|
||||||
[ --without-inotify Do not use Linux inotify event interface. On by default.])
|
|
||||||
if test "x${with_inotify}" == xno; then
|
####
|
||||||
echo "compiling without inotify"
|
## --without-inotify option
|
||||||
else
|
#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"
|
echo "compiling with inotify"
|
||||||
AC_DEFINE(LSYNCD_WITH_INOTIFY,,"descr")
|
AC_DEFINE(LSYNCD_WITH_INOTIFY,,"descr")
|
||||||
fi
|
#fi
|
||||||
AM_CONDITIONAL([INOTIFY], [test x${with_inotify} != xno])
|
AM_CONDITIONAL([INOTIFY], [test x${with_inotify} != xno])
|
||||||
|
|
||||||
###
|
####
|
||||||
# --with-fanotify option
|
## --with-fanotify option
|
||||||
##
|
##
|
||||||
#AC_ARG_WITH([fanotify],
|
#AC_ARG_WITH([fanotify],
|
||||||
#[ --with-fanotify Uses Linux new fanotify event interface. EXPERIMENTAL!
|
#[ --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!"
|
# echo "compiling with fanotify - WARNING experimental!"
|
||||||
# AC_DEFINE(LSYNCD_WITH_FANOTIFY,,"descr")
|
# AC_DEFINE(LSYNCD_WITH_FANOTIFY,,"descr")
|
||||||
##fi
|
##fi
|
||||||
#AM_CONDITIONAL([FANOTIFY],
|
AM_CONDITIONAL([FANOTIFY],
|
||||||
# [test x${with_fanotify} != x -a x${with_fanotify} != xno])
|
[test x${with_fanotify} != x -a x${with_fanotify} != xno])
|
||||||
|
|
||||||
###
|
####
|
||||||
# --with-fsevents
|
## --with-fsevents
|
||||||
AC_ARG_WITH([fsevents],
|
#AC_ARG_WITH([fsevents],
|
||||||
[ --with-fsevents Uses MacOS (10.5) /dev/fsevents. EXPERIMENTAL!
|
#[ --with-fsevents Uses MacOS (10.5) /dev/fsevents. EXPERIMENTAL!
|
||||||
Off by default.])
|
# Off by default.])
|
||||||
if test "x${with_fsevents}" != x; then
|
#if test "x${with_fsevents}" != x; then
|
||||||
echo "compiling with fsevents. WARNING experimental!"
|
# echo "compiling with fsevents. WARNING experimental!"
|
||||||
AC_DEFINE(LSYNCD_WITH_FSEVENTS,,"descr")
|
# AC_DEFINE(LSYNCD_WITH_FSEVENTS,,"descr")
|
||||||
else
|
#else
|
||||||
echo "compiling without fsevents"
|
# echo "compiling without fsevents"
|
||||||
fi
|
#fi
|
||||||
AM_CONDITIONAL([FSEVENTS],
|
AM_CONDITIONAL([FSEVENTS],
|
||||||
[test x${with_fsevents} != x -a xno${with_fsevents} != xno])
|
[test x${with_fsevents} != x -a xno${with_fsevents} != xno])
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ lsyncd(1)
|
|||||||
:doctype: manpage
|
:doctype: manpage
|
||||||
:man source: Lsyncd
|
:man source: Lsyncd
|
||||||
:man manual: Lsyncd
|
:man manual: Lsyncd
|
||||||
:man version: 2.0
|
:man version: 2.0.0
|
||||||
:date: December 2010
|
:date: December 2010
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
@ -84,7 +84,7 @@ Online Manual: http://code.google.com/p/lsyncd/wiki/Lsyncd2
|
|||||||
|
|
||||||
VERSION
|
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
|
AUTHOR
|
||||||
------
|
------
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
* volume to determine "what changed".
|
* volume to determine "what changed".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#error "This code is not yet finished."
|
||||||
|
|
||||||
#include "lsyncd.h"
|
#include "lsyncd.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
1
lsyncd.c
1
lsyncd.c
@ -541,7 +541,6 @@ observe_fd(int fd,
|
|||||||
observances[pos].extra = extra;
|
observances[pos].extra = extra;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("new observance %d:%d\n", fd, pos);
|
|
||||||
|
|
||||||
if (observance_action) {
|
if (observance_action) {
|
||||||
// TODO
|
// TODO
|
||||||
|
112
lsyncd.lua
112
lsyncd.lua
@ -20,7 +20,7 @@ if lsyncd_version then
|
|||||||
"You cannot use the lsyncd runner as configuration file!")
|
"You cannot use the lsyncd runner as configuration file!")
|
||||||
lsyncd.terminate(-1) -- ERRNO
|
lsyncd.terminate(-1) -- ERRNO
|
||||||
end
|
end
|
||||||
lsyncd_version = "2.0beta3"
|
lsyncd_version = "2.0.0"
|
||||||
|
|
||||||
-----
|
-----
|
||||||
-- Hides the core interface from user scripts
|
-- Hides the core interface from user scripts
|
||||||
@ -281,7 +281,7 @@ local Combiner = (function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-----
|
-----
|
||||||
-- TODO
|
-- Table how to combine events that dont involve a move.
|
||||||
--
|
--
|
||||||
local combineNoMove = {
|
local combineNoMove = {
|
||||||
Attrib = {Attrib=abso, Modify=repl, Create=repl, Delete=repl },
|
Attrib = {Attrib=abso, Modify=repl, Create=repl, Delete=repl },
|
||||||
@ -733,7 +733,7 @@ local InletFactory = (function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-----
|
-----
|
||||||
-- TODO
|
-- The functions the inlet provides.
|
||||||
--
|
--
|
||||||
local inletFuncs = {
|
local inletFuncs = {
|
||||||
-----
|
-----
|
||||||
@ -1358,7 +1358,6 @@ local Sync = (function()
|
|||||||
local st = vd.status
|
local st = vd.status
|
||||||
f:write(st, string.sub(spaces, 1, 7 - #st))
|
f:write(st, string.sub(spaces, 1, 7 - #st))
|
||||||
f:write(vd.etype," ")
|
f:write(vd.etype," ")
|
||||||
-- TODO spaces
|
|
||||||
f:write(vd.path)
|
f:write(vd.path)
|
||||||
if (vd.path2) then
|
if (vd.path2) then
|
||||||
f:write(" -> ",vd.path2)
|
f:write(" -> ",vd.path2)
|
||||||
@ -1821,61 +1820,60 @@ local Inotify = (function()
|
|||||||
}
|
}
|
||||||
end)()
|
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()
|
-- -----
|
||||||
-----
|
-- -- Called when any event has occured.
|
||||||
-- A list indexed by sync's containing the root path this
|
-- --
|
||||||
-- sync is interested in.
|
-- -- @param etype "Attrib", "Mofify", "Create", "Delete", "Move")
|
||||||
--
|
-- -- @param wd watch descriptor (matches lsyncd.inotifyadd())
|
||||||
local syncPaths = {}
|
-- -- @param isdir true if filename is a directory
|
||||||
|
-- -- @param time time of event
|
||||||
-----
|
-- -- @param filename string filename without path
|
||||||
-- adds a Sync to receive events
|
-- -- @param filename2
|
||||||
--
|
-- --
|
||||||
-- @param sync Object to receive events
|
-- local function event(etype, isdir, time, filename, filename2)
|
||||||
-- @param dir dir to watch
|
-- log("Fsevents", etype, isdir, time, filename, filename2)
|
||||||
--
|
-- end
|
||||||
local function addSync(sync, dir)
|
--
|
||||||
if syncRoots[sync] then
|
-- -----
|
||||||
error("duplicate sync in Fanotify.addSync()")
|
-- -- Writes a status report about inotifies to a filedescriptor
|
||||||
end
|
-- --
|
||||||
-- TODO for non subdirs adddir only
|
-- local function statusReport(f)
|
||||||
lsyncd.fanotify.watchfs(dir)
|
-- -- TODO
|
||||||
syncRoots[sync] = dir
|
-- end
|
||||||
end
|
--
|
||||||
|
-- -- public interface
|
||||||
-----
|
-- return {
|
||||||
-- Called when any event has occured.
|
-- addSync = addSync,
|
||||||
--
|
-- event = event,
|
||||||
-- @param etype "Attrib", "Mofify", "Create", "Delete", "Move")
|
-- statusReport = statusReport
|
||||||
-- @param wd watch descriptor (matches lsyncd.inotifyadd())
|
-- }
|
||||||
-- @param isdir true if filename is a directory
|
--end)()
|
||||||
-- @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)()
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
-- Holds information about the event monitor capabilities
|
-- Holds information about the event monitor capabilities
|
||||||
|
Loading…
Reference in New Issue
Block a user