diff options
author | Hans Hagen <pragma@wxs.nl> | 2011-02-04 19:31:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2011-02-04 19:31:00 +0100 |
commit | 2f454cead3e88e35ba868e6668840a59e22617d2 (patch) | |
tree | edfa4d60aaf339ba62e246ebb438fc05f02fab9f /scripts | |
parent | 70af4c3a0a64e754888e3a78c7d49e3ca0803264 (diff) | |
download | context-2f454cead3e88e35ba868e6668840a59e22617d2.tar.gz |
beta 2011.02.04 19:31
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 43 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 43 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/mtxrun | 43 |
3 files changed, 69 insertions, 60 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 4ada628ea..31d7d9b0f 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -4877,16 +4877,6 @@ local t_enable, t_disable = trackers .enable, trackers .disable local d_enable, d_disable = directives .enable, directives .disable local e_enable, e_disable = experiments.enable, experiments.disable --- experiment - -if trackers and environment and environment.engineflags.trackers then - t_enable(environment.engineflags.trackers) -end - -if directives and environment and environment.engineflags.directives then - d_enable(environment.engineflags.directives) -end - -- nice trick: we overload two of the directives related functions with variants that -- do tracing (itself using a tracker) .. proof of concept @@ -4930,11 +4920,15 @@ end) -- experiment -if trackers and environment and environment.engineflags.trackers then - t_enable(environment.engineflags.trackers) -end -if directives and environment and environment.engineflags.directives then - d_enable(environment.engineflags.directives) +local flags = environment and environment.engineflags + +if flags then + if trackers and flags.trackers then + t_enable(flags.trackers) + end + if directives and flags.directives then + d_enable(flags.directives) + end end -- here @@ -11695,6 +11689,7 @@ end local function findgivenfiles(filename,allresults) local bname, result = filebasename(filename), { } local hashes = instance.hashes + local noffound = 0 for k=1,#hashes do local hash = hashes[k] local files = instance.files[hash.name] or { } @@ -11709,13 +11704,21 @@ local function findgivenfiles(filename,allresults) end if blist then if type(blist) == 'string' then - result[#result+1] = methodhandler('concatinators',hash.type,hash.name,blist,bname) or "" - if not allresults then break end + local found = methodhandler('concatinators',hash.type,hash.name,blist,bname) or "" + if found ~= "" then + noffound = noffound + 1 + result[noffound] = resolvers.resolve(found) + if not allresults then break end + end else for kk=1,#blist do local vv = blist[kk] - result[#result+1] = methodhandler('concatinators',hash.type,hash.name,vv,bname) or "" - if not allresults then break end + local found = methodhandler('concatinators',hash.type,hash.name,vv,bname) or "" + if found ~= "" then + noffound = noffound + 1 + result[noffound] = resolvers.resolve(found) + if not allresults then break end + end end end end @@ -11993,7 +11996,7 @@ prefixes.environment = function(str) return cleanpath(expansion(str)) end -prefixes.relative = function(str,n) +prefixes.relative = function(str,n) -- lfs.isfile if io.exists(str) then -- nothing elseif io.exists("./" .. str) then diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 4ada628ea..31d7d9b0f 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -4877,16 +4877,6 @@ local t_enable, t_disable = trackers .enable, trackers .disable local d_enable, d_disable = directives .enable, directives .disable local e_enable, e_disable = experiments.enable, experiments.disable --- experiment - -if trackers and environment and environment.engineflags.trackers then - t_enable(environment.engineflags.trackers) -end - -if directives and environment and environment.engineflags.directives then - d_enable(environment.engineflags.directives) -end - -- nice trick: we overload two of the directives related functions with variants that -- do tracing (itself using a tracker) .. proof of concept @@ -4930,11 +4920,15 @@ end) -- experiment -if trackers and environment and environment.engineflags.trackers then - t_enable(environment.engineflags.trackers) -end -if directives and environment and environment.engineflags.directives then - d_enable(environment.engineflags.directives) +local flags = environment and environment.engineflags + +if flags then + if trackers and flags.trackers then + t_enable(flags.trackers) + end + if directives and flags.directives then + d_enable(flags.directives) + end end -- here @@ -11695,6 +11689,7 @@ end local function findgivenfiles(filename,allresults) local bname, result = filebasename(filename), { } local hashes = instance.hashes + local noffound = 0 for k=1,#hashes do local hash = hashes[k] local files = instance.files[hash.name] or { } @@ -11709,13 +11704,21 @@ local function findgivenfiles(filename,allresults) end if blist then if type(blist) == 'string' then - result[#result+1] = methodhandler('concatinators',hash.type,hash.name,blist,bname) or "" - if not allresults then break end + local found = methodhandler('concatinators',hash.type,hash.name,blist,bname) or "" + if found ~= "" then + noffound = noffound + 1 + result[noffound] = resolvers.resolve(found) + if not allresults then break end + end else for kk=1,#blist do local vv = blist[kk] - result[#result+1] = methodhandler('concatinators',hash.type,hash.name,vv,bname) or "" - if not allresults then break end + local found = methodhandler('concatinators',hash.type,hash.name,vv,bname) or "" + if found ~= "" then + noffound = noffound + 1 + result[noffound] = resolvers.resolve(found) + if not allresults then break end + end end end end @@ -11993,7 +11996,7 @@ prefixes.environment = function(str) return cleanpath(expansion(str)) end -prefixes.relative = function(str,n) +prefixes.relative = function(str,n) -- lfs.isfile if io.exists(str) then -- nothing elseif io.exists("./" .. str) then diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 4ada628ea..31d7d9b0f 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -4877,16 +4877,6 @@ local t_enable, t_disable = trackers .enable, trackers .disable local d_enable, d_disable = directives .enable, directives .disable local e_enable, e_disable = experiments.enable, experiments.disable --- experiment - -if trackers and environment and environment.engineflags.trackers then - t_enable(environment.engineflags.trackers) -end - -if directives and environment and environment.engineflags.directives then - d_enable(environment.engineflags.directives) -end - -- nice trick: we overload two of the directives related functions with variants that -- do tracing (itself using a tracker) .. proof of concept @@ -4930,11 +4920,15 @@ end) -- experiment -if trackers and environment and environment.engineflags.trackers then - t_enable(environment.engineflags.trackers) -end -if directives and environment and environment.engineflags.directives then - d_enable(environment.engineflags.directives) +local flags = environment and environment.engineflags + +if flags then + if trackers and flags.trackers then + t_enable(flags.trackers) + end + if directives and flags.directives then + d_enable(flags.directives) + end end -- here @@ -11695,6 +11689,7 @@ end local function findgivenfiles(filename,allresults) local bname, result = filebasename(filename), { } local hashes = instance.hashes + local noffound = 0 for k=1,#hashes do local hash = hashes[k] local files = instance.files[hash.name] or { } @@ -11709,13 +11704,21 @@ local function findgivenfiles(filename,allresults) end if blist then if type(blist) == 'string' then - result[#result+1] = methodhandler('concatinators',hash.type,hash.name,blist,bname) or "" - if not allresults then break end + local found = methodhandler('concatinators',hash.type,hash.name,blist,bname) or "" + if found ~= "" then + noffound = noffound + 1 + result[noffound] = resolvers.resolve(found) + if not allresults then break end + end else for kk=1,#blist do local vv = blist[kk] - result[#result+1] = methodhandler('concatinators',hash.type,hash.name,vv,bname) or "" - if not allresults then break end + local found = methodhandler('concatinators',hash.type,hash.name,vv,bname) or "" + if found ~= "" then + noffound = noffound + 1 + result[noffound] = resolvers.resolve(found) + if not allresults then break end + end end end end @@ -11993,7 +11996,7 @@ prefixes.environment = function(str) return cleanpath(expansion(str)) end -prefixes.relative = function(str,n) +prefixes.relative = function(str,n) -- lfs.isfile if io.exists(str) then -- nothing elseif io.exists("./" .. str) then |