diff options
| author | ruki <[email protected]> | 2020-10-25 21:02:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-25 21:02:19 +0800 |
| commit | 4f11f7dc3c168501d2a415bebe568bf0e176f60a (patch) | |
| tree | 4a6ca5e9f7dbad6a63a4f8031e956f04804badca | |
| parent | 3515c89211579318a597e1e9474c19e48442bcb4 (diff) | |
improve xrepo
| -rw-r--r-- | xmake/actions/require/fetch.lua | 2 | ||||
| -rw-r--r-- | xmake/core/package/package.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/export.lua | 5 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/fetch.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/install.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/remove.lua | 5 |
6 files changed, 7 insertions, 19 deletions
diff --git a/xmake/actions/require/fetch.lua b/xmake/actions/require/fetch.lua index 7db2e214f..87a907916 100644 --- a/xmake/actions/require/fetch.lua +++ b/xmake/actions/require/fetch.lua @@ -47,7 +47,7 @@ function main(requires_raw) -- fetch all packages local fetchinfos = {} - for _, instance in ipairs(package.load_packages(requires, {requires_extra = requires_extra})) do + for _, instance in ipairs(package.load_packages(requires, {requires_extra = requires_extra, nodeps = true})) do local fetchinfo if fetchmodes and fetchmodes:has("deps") then fetchinfo = instance:fetchdeps() diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index ba66ecdd5..398c89285 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -908,8 +908,6 @@ function _instance:fetch(opt) if isSys ~= nil then self._isSys = isSys end - - -- ok return fetchinfo end diff --git a/xmake/modules/private/xrepo/action/export.lua b/xmake/modules/private/xrepo/action/export.lua index c9fd20a99..0be2ab050 100644 --- a/xmake/modules/private/xrepo/action/export.lua +++ b/xmake/modules/private/xrepo/action/export.lua @@ -127,19 +127,16 @@ function _export_packages(packages) if outputdir then table.insert(require_argv, "--exportdir=" .. outputdir) end - local extra = nil + local extra = {system = false} if mode == "debug" then - extra = extra or {} extra.debug = true end if kind == "shared" then - extra = extra or {} extra.configs = extra.configs or {} extra.configs.shared = true end local configs = option.get("configs") if configs then - extra = extra or {} extra.configs = extra.configs or {} local extra_configs, errors = ("{" .. configs .. "}"):deserialize() if extra_configs then diff --git a/xmake/modules/private/xrepo/action/fetch.lua b/xmake/modules/private/xrepo/action/fetch.lua index 6b79928ad..d8d524de2 100644 --- a/xmake/modules/private/xrepo/action/fetch.lua +++ b/xmake/modules/private/xrepo/action/fetch.lua @@ -36,6 +36,7 @@ function menu_options() {'a', "arch", "kv", nil, "Set the given architecture." }, {'m', "mode", "kv", nil, "Set the given mode.", values = {"release", "debug"} }, + {nil, "system", "k", nil, "Attempt to fetch system packages." }, {nil, "configs", "kv", nil, "Set the given extra package configs.", "e.g.", " - xrepo fetch --configs=\"vs_runtime=MD\" zlib", @@ -135,19 +136,16 @@ function _fetch_packages(packages) if #fetchmodes > 0 then table.insert(require_argv, "--fetch_modes=" .. table.concat(fetchmodes, ',')) end - local extra = nil + local extra = {system = option.get("system") and true or false} if mode == "debug" then - extra = extra or {} extra.debug = true end if kind == "shared" then - extra = extra or {} extra.configs = extra.configs or {} extra.configs.shared = true end local configs = option.get("configs") if configs then - extra = extra or {} extra.configs = extra.configs or {} local extra_configs, errors = ("{" .. configs .. "}"):deserialize() if extra_configs then diff --git a/xmake/modules/private/xrepo/action/install.lua b/xmake/modules/private/xrepo/action/install.lua index 0551fa3c9..a9ff09634 100644 --- a/xmake/modules/private/xrepo/action/install.lua +++ b/xmake/modules/private/xrepo/action/install.lua @@ -139,19 +139,17 @@ function _install_packages(packages) if option.get("shallow") then table.insert(require_argv, "--shallow") end - local extra = nil + local extra = {system = false} if mode == "debug" then - extra = extra or {} extra.debug = true end if kind == "shared" then - extra = extra or {} extra.configs = extra.configs or {} extra.configs.shared = true end local configs = option.get("configs") if configs then - extra = extra or {} + extra.system = false extra.configs = extra.configs or {} local extra_configs, errors = ("{" .. configs .. "}"):deserialize() if extra_configs then diff --git a/xmake/modules/private/xrepo/action/remove.lua b/xmake/modules/private/xrepo/action/remove.lua index 29d562899..913748918 100644 --- a/xmake/modules/private/xrepo/action/remove.lua +++ b/xmake/modules/private/xrepo/action/remove.lua @@ -118,19 +118,16 @@ function _remove_packages(packages) if option.get("diagnosis") then table.insert(require_argv, "-D") end - local extra = nil + local extra = {system = false} if mode == "debug" then - extra = extra or {} extra.debug = true end if kind == "shared" then - extra = extra or {} extra.configs = extra.configs or {} extra.configs.shared = true end local configs = option.get("configs") if configs then - extra = extra or {} extra.configs = extra.configs or {} local extra_configs, errors = ("{" .. configs .. "}"):deserialize() if extra_configs then |
