From 117a64d7e156223d417bbec2ded3295fbede9851 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Wed, 19 Jan 2011 15:30:19 +0000 Subject: [PATCH] use excludes on startup rsyncs --- lsyncd.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lsyncd.lua b/lsyncd.lua index eee48fa..6ccc6d7 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -869,8 +869,8 @@ local InletFactory = (function() -- creates a copy local e = {} local en = 1; - for _, v in pairs(sync.excludes.list) do - e[en] = v; + for k, _ in pairs(sync.excludes.list) do + e[en] = k; en = en + 1; end return e; @@ -1011,6 +1011,10 @@ local Excludes = (function() -- this was a ** before p = string.gsub(p, "%[%^/%]%*%[%^/%]%*", ".*") p = string.gsub(p, "^/", "^/") + if p.byte(1) ~= 47 then -- does not begin with "/" + -- all matches should begin with "/". + p = "/" .. p; + end log("Exclude", "toLuaPattern '",o,"' = '",p,'"') return p end