mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-06-07 10:50:51 +00:00
fixed moves from deleted dirs
This commit is contained in:
parent
d43c07c6ae
commit
38dc3c1d2f
23
lsyncd.lua
23
lsyncd.lua
|
@ -1590,17 +1590,28 @@ local Inotifies = (function()
|
||||||
|
|
||||||
-- looks up the watch descriptor id
|
-- looks up the watch descriptor id
|
||||||
local path = wdpaths[wd]
|
local path = wdpaths[wd]
|
||||||
|
if path then
|
||||||
|
path = path..filename
|
||||||
|
end
|
||||||
|
|
||||||
|
local path2 = wd2 and wdpaths[wd2]
|
||||||
|
if path2 and filename2 then
|
||||||
|
path2 = path2..filename2
|
||||||
|
end
|
||||||
|
|
||||||
|
if not path and path2 and etype =="Move" then
|
||||||
|
log("Inotify", "Move from deleted directory ",path2,
|
||||||
|
" becomes Create.")
|
||||||
|
path = path2
|
||||||
|
path2 = nil
|
||||||
|
etype = "Create"
|
||||||
|
end
|
||||||
|
|
||||||
if not path then
|
if not path then
|
||||||
-- this is normal in case of deleted subdirs
|
-- this is normal in case of deleted subdirs
|
||||||
log("Inotify", "event belongs to unknown watch descriptor.")
|
log("Inotify", "event belongs to unknown watch descriptor.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
path = path..filename
|
|
||||||
|
|
||||||
local path2 = wd2 and wdpaths[wd2]
|
|
||||||
if path2 and filename2 then
|
|
||||||
path2 = path2..filename2
|
|
||||||
end
|
|
||||||
|
|
||||||
for sync, root in pairs(syncRoots) do repeat
|
for sync, root in pairs(syncRoots) do repeat
|
||||||
local relative = splitPath(path, root)
|
local relative = splitPath(path, root)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user