From f09ac240a792d673754d081b0230c3969fe020ac Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Tue, 9 Oct 2012 18:06:46 +0200 Subject: [PATCH] properly reconstruct settings variable in case of backward compatibly accepting it as deprecated variable --- lsyncd.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lsyncd.lua b/lsyncd.lua index ebbcbc1..543a183 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -2269,6 +2269,22 @@ local Syncs = ( function( ) -- local function add( config ) + -- workaround for backwards compatibility + -- FIXME: remove when dropping that + if settings ~= settingsSafe then + log( + 'Warn', + 'settings = { ... } is deprecated.\n'.. + ' please use settings{ ... } (without the equal sign)' + ) + + for k, v in pairs( settings ) do + uSettings[ k ] = v + end + + settings = settingsSafe + end + -- Creates a new config table which inherits all keys/values -- from integer keyed tables local uconfig = config @@ -3782,7 +3798,9 @@ function runner.initialize( firstTime ) ' please use settings{ ... } (without the equal sign)' ) - uSettings = settings + for k, v in pairs( settings ) do + uSettings[ k ] = v + end end