diff options
| author | ruki <[email protected]> | 2019-01-29 22:38:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-01-29 09:49:37 +0800 |
| commit | f0efa9f471824ead88a98ca8cf3387c88606e051 (patch) | |
| tree | 39c3821d35aeb8342b744225e9b377ae525ddcf7 | |
| parent | 2a8b05d146a9fd53aa5784e36dca45cbce2ce272 (diff) | |
fix load requires with alias
| -rw-r--r-- | xmake/actions/require/impl/action/download.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/require/impl/action/install.lua | 8 | ||||
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 4 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua index 940ef4d5c..a01d9aef2 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/action/download.lua @@ -206,7 +206,7 @@ function main(package) function (errors) -- verbose? - if option.get("verbose") and errors then + if (option.get("verbose") or option.get("diagnosis")) and errors then cprint("${dim color.error}error: ${clear}%s", errors) end diff --git a/xmake/actions/require/impl/action/install.lua b/xmake/actions/require/impl/action/install.lua index 07fd34e02..181bded44 100644 --- a/xmake/actions/require/impl/action/install.lua +++ b/xmake/actions/require/impl/action/install.lua @@ -59,7 +59,7 @@ function main(package) -- trace cprintf("${yellow} => ${clear}installing %s .. ", tipname) - if option.get("verbose") then + if option.get("verbose") or option.get("diagnosis") then print("") end @@ -118,7 +118,7 @@ function main(package) end -- install package - if option.get("verbose") then + if option.get("verbose") or option.get("diagnosis") then installtask() else process.asyncrun(installtask) @@ -126,7 +126,7 @@ function main(package) -- fetch package and force to flush the cache local fetchinfo = package:fetch({force = true}) - if option.get("verbose") then + if option.get("verbose") or option.get("diagnosis") then print(fetchinfo) end assert(fetchinfo, "fetch %s failed!", tipname) @@ -140,7 +140,7 @@ function main(package) function (errors) -- verbose? - if option.get("verbose") and errors then + if (option.get("verbose") or option.get("diagnosis")) and errors then cprint("${dim color.error}error: ${clear}%s", errors) end diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index 607c1a9ae..d362563a4 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -480,10 +480,10 @@ function install_packages(requires, opt) action.download(package) end - end, #packages_download, ifelse(option.get("verbose"), 1, 4), 300, function (indices) + end, #packages_download, ifelse((option.get("verbose") or option.get("diagnosis")), 1, 4), 300, function (indices) -- do not print progress info if be verbose - if option.get("verbose") then + if option.get("verbose") or option.get("diagnosis") then return end diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 4d5c67dab..0d7289a90 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -638,7 +638,7 @@ function project._load_requires() instance = table.inherit(requireinfo) -- save name and info - instance._NAME = packagename + instance._NAME = alias or packagename instance._INFO = { __requirestr = requirestr, __extrainfo = extrainfo } end diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index 3718f4c69..fa0502318 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -316,24 +316,24 @@ end function sandbox_os.vrun(cmd, ...) -- echo command - if option.get("verbose") then + if option.get("verbose") or option.get("diagnosis") then print(vformat(cmd, ...)) end -- run it - utils.ifelse(option.get("verbose"), sandbox_os.exec, sandbox_os.run)(cmd, ...) + utils.ifelse(option.get("verbose") or option.get("diagnosis"), sandbox_os.exec, sandbox_os.run)(cmd, ...) end -- quietly run command with arguments list and echo verbose info if [-v|--verbose] option is enabled function sandbox_os.vrunv(program, argv, opt) -- echo command - if option.get("verbose") then + if option.get("verbose") or option.get("diagnosis") then print(vformat(program), table.concat(argv, " ")) end -- run it - utils.ifelse(option.get("verbose"), sandbox_os.execv, sandbox_os.runv)(program, argv, opt) + utils.ifelse(option.get("verbose") or option.get("diagnosis"), sandbox_os.execv, sandbox_os.runv)(program, argv, opt) end -- run command and return output and error data |
