summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2013-07-31 20:23:00 +0200
committerHans Hagen <pragma@wxs.nl>2013-07-31 20:23:00 +0200
commitbcad533e9ab26e0b6cf2fe84af11ba012d8dd76c (patch)
tree0027557efa7c8c069b37ff573fd259c73314ee0e /scripts
parent0804923254f208f75c4da536fec9f51d85a4dbb4 (diff)
downloadcontext-bcad533e9ab26e0b6cf2fe84af11ba012d8dd76c.tar.gz
beta 2013.07.31 20:23
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-rsync.lua21
-rw-r--r--scripts/context/lua/mtxrun.lua10
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua10
-rwxr-xr-xscripts/context/stubs/unix/mtxrun10
4 files changed, 29 insertions, 22 deletions
diff --git a/scripts/context/lua/mtx-rsync.lua b/scripts/context/lua/mtx-rsync.lua
index 65f795ee5..70a82e929 100644
--- a/scripts/context/lua/mtx-rsync.lua
+++ b/scripts/context/lua/mtx-rsync.lua
@@ -92,14 +92,20 @@ else
end
end
-function rsynccommand(dryrun,recurse,origin,target)
- local command = "rsync -ptlva "
+function rsynccommand(origin,target,dryrun,recurse,delete)
+ local command = "rsync -t -p "
if dryrun then
command = command .. "-n "
end
if recurse then
command = command .. "-r "
end
+ if delete then
+ if not recurse then
+ command = command .. "-d "
+ end
+ command = command .. "--delete "
+ end
return format('%s %s %s',command,origin,target)
end
@@ -109,7 +115,7 @@ local rsync = scripts.rsync
rsync.mode = "command"
-function rsync.run(origin,target,message,recurse)
+function rsync.run(origin,target,message,recurse,delete)
if type(origin) == "table" then
origin = concat(origin,"/")
end
@@ -127,15 +133,15 @@ function rsync.run(origin,target,message,recurse)
report_message(message)
end
if rsync.mode == "dryrun" then
- local command = rsynccommand(true,recurse,origin,target)
+ local command = rsynccommand(origin,target,true,recurse,delete)
report_dryrun(command.."\n")
os.execute(command)
elseif rsync.mode == "force" then
- local command = rsynccommand(false,recurse,origin,target)
+ local command = rsynccommand(origin,target,false,recurse,delete)
report_normal(command.."\n")
os.execute(command)
else
- local command = rsynccommand(true,recurse,origin,target)
+ local command = rsynccommand(origin,target,true,recurse,delete)
report_command(command)
end
end
@@ -154,8 +160,9 @@ function rsync.job(list)
local target = li.target
local message = li.message
local recurse = li.recurse
+ local delete = li.delete
if origin and #origin > 0 and target and #target > 0 then -- string or table
- rsync.run(origin,target,message,recurse)
+ rsync.run(origin,target,message,recurse,delete)
else
report_message("invalid job specification at index %s",i)
end
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 62a9fd3bc..61f2b8f4f 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -3966,7 +3966,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-boolean"] = package.loaded["l-boolean"] or true
--- original size: 1781, stripped down to: 1503
+-- original size: 1809, stripped down to: 1527
if not modules then modules={} end modules ['l-boolean']={
version=1.001,
@@ -4022,9 +4022,9 @@ function string.booleanstring(str)
end
function string.is_boolean(str,default)
if type(str)=="string" then
- if str=="true" or str=="yes" or str=="on" or str=="t" then
+ if str=="true" or str=="yes" or str=="on" or str=="t" or str=="1" then
return true
- elseif str=="false" or str=="no" or str=="off" or str=="f" then
+ elseif str=="false" or str=="no" or str=="off" or str=="f" or str=="0" then
return false
end
end
@@ -16261,8 +16261,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 663473
--- stripped bytes : 233126
+-- original bytes : 663501
+-- stripped bytes : 233130
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 62a9fd3bc..61f2b8f4f 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -3966,7 +3966,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-boolean"] = package.loaded["l-boolean"] or true
--- original size: 1781, stripped down to: 1503
+-- original size: 1809, stripped down to: 1527
if not modules then modules={} end modules ['l-boolean']={
version=1.001,
@@ -4022,9 +4022,9 @@ function string.booleanstring(str)
end
function string.is_boolean(str,default)
if type(str)=="string" then
- if str=="true" or str=="yes" or str=="on" or str=="t" then
+ if str=="true" or str=="yes" or str=="on" or str=="t" or str=="1" then
return true
- elseif str=="false" or str=="no" or str=="off" or str=="f" then
+ elseif str=="false" or str=="no" or str=="off" or str=="f" or str=="0" then
return false
end
end
@@ -16261,8 +16261,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 663473
--- stripped bytes : 233126
+-- original bytes : 663501
+-- stripped bytes : 233130
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 62a9fd3bc..61f2b8f4f 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -3966,7 +3966,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-boolean"] = package.loaded["l-boolean"] or true
--- original size: 1781, stripped down to: 1503
+-- original size: 1809, stripped down to: 1527
if not modules then modules={} end modules ['l-boolean']={
version=1.001,
@@ -4022,9 +4022,9 @@ function string.booleanstring(str)
end
function string.is_boolean(str,default)
if type(str)=="string" then
- if str=="true" or str=="yes" or str=="on" or str=="t" then
+ if str=="true" or str=="yes" or str=="on" or str=="t" or str=="1" then
return true
- elseif str=="false" or str=="no" or str=="off" or str=="f" then
+ elseif str=="false" or str=="no" or str=="off" or str=="f" or str=="0" then
return false
end
end
@@ -16261,8 +16261,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 663473
--- stripped bytes : 233126
+-- original bytes : 663501
+-- stripped bytes : 233130
-- end library merge