diff options
author | Marius <mariausol@gmail.com> | 2013-02-18 17:00:30 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-02-18 17:00:30 +0200 |
commit | 194a9daae885e85e4970143daffd1b9f9080ccf5 (patch) | |
tree | 8e26a5aa2ef0c01f9eb6bd86abc664cd8af6c523 /scripts/context/lua/mtx-update.lua | |
parent | 13706211c6f53d83a620a845c9c0e5bb736345a3 (diff) | |
download | context-194a9daae885e85e4970143daffd1b9f9080ccf5.tar.gz |
beta 2013.02.18 15:46
Diffstat (limited to 'scripts/context/lua/mtx-update.lua')
-rw-r--r-- | scripts/context/lua/mtx-update.lua | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index 59acf8648..8eee996b5 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -28,6 +28,8 @@ local helpinfo = [[ --make also make formats and generate file databases --keep don't delete unused or obsolete files --state update tree using saved state +--cygwin adapt drive specs to cygwin +--mingw assume mingw binaries being used ]] local application = logs.application { @@ -205,6 +207,17 @@ function scripts.update.fullpath(path) end end +local rsync_variant = "cygwin" -- will be come mingw + +local function drive(d) + if rsync_variant == "cygwin" then + d = gsub(d,[[([a-zA-Z]):/]], "/cygdrive/%1/") + else + d = gsub(d,[[([a-zA-Z]):/]], "/%1/") + end + return d +end + function scripts.update.synchronize() report("update, start") @@ -346,7 +359,7 @@ function scripts.update.synchronize() destination = gsub(destination,"\\","/") archive = gsub(archive,"<version>",version) if osplatform == "windows" or osplatform == "mswin" then - destination = gsub(destination,"([a-zA-Z]):/", "/cygdrive/%1/") -- ^ + destination = drive(destination) end individual[#individual+1] = { archive, destination } end @@ -421,8 +434,8 @@ function scripts.update.synchronize() if platform then local command if platform == 'mswin' then - bin = gsub(bin,"([a-zA-Z]):/", "/cygdrive/%1/") - texroot = gsub(texroot,"([a-zA-Z]):/", "/cygdrive/%1/") + bin = drive(bin) + texroot = drive(texroot) command = format([[%s -t "%s/texmf-context/scripts/context/lua/%s.lua" "%s/texmf-mswin/bin/"]], bin, texroot, script, texroot) else command = format([[%s -tgo --chmod=a+x '%s/texmf-context/scripts/context/lua/%s.lua' '%s/texmf-%s/bin/%s']], bin, texroot, script, texroot, platform, script) @@ -620,6 +633,12 @@ if environment.argument("state") then environment.setargument("make",true) end +if environment.argument("mingw") then + rsync_variant = "mingw" +elseif environment.argument("cygwin") then + rsync_variant = "cygwin" +end + if environment.argument("update") then scripts.update.synchronize() if environment.argument("make") then |