diff options
| author | ruki <[email protected]> | 2021-03-12 00:48:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-03-12 00:48:47 +0800 |
| commit | baa4c6ab9d2c7b6ff03255b8cc1a7890d9ef6602 (patch) | |
| tree | 2fb6b1c1ab7f27413e52fc0bee6bdecb9586349f /xmake/core/package/package.lua | |
| parent | 6235369194c12c47b6977970d2ae2b1e92c4deb5 (diff) | |
rename :optional to is_optional
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 36a50146b..6794a4359 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -343,6 +343,38 @@ function _instance:is_fetchonly() return self:get("fetch") and not self:get("install") end +-- is optional package? +function _instance:is_optional() + local requireinfo = self:requireinfo() + return requireinfo and requireinfo.optional or false +end + +-- verify sha256sum and versions? +function _instance:verify() + local requireinfo = self:requireinfo() + local verify = requireinfo and requireinfo.verify + if verify == nil then + verify = true + end + return verify +end + +-- is debug package? +function _instance:debug() + return self:config("debug") +end + +-- is the supported package? +function _instance:supported() + -- attempt to get the install script with the current plat/arch + return self:script("install") ~= nil +end + +-- support parallelize for installation? +function _instance:parallelize() + return self:get("parallelize") ~= false +end + -- get the filelock of the whole package directory function _instance:filelock() local filelock = self._FILELOCK @@ -908,38 +940,6 @@ function _instance:group() end end --- is optional package? -function _instance:optional() - local requireinfo = self:requireinfo() - return requireinfo and requireinfo.optional or false -end - --- verify sha256sum and versions? -function _instance:verify() - local requireinfo = self:requireinfo() - local verify = requireinfo and requireinfo.verify - if verify == nil then - verify = true - end - return verify -end - --- is debug package? -function _instance:debug() - return self:config("debug") -end - --- is the supported package? -function _instance:supported() - -- attempt to get the install script with the current plat/arch - return self:script("install") ~= nil -end - --- support parallelize for installation? -function _instance:parallelize() - return self:get("parallelize") ~= false -end - -- get xxx_script function _instance:script(name, generic) |
