summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-06-01 00:45:48 +0800
committerruki <[email protected]>2024-06-01 00:45:48 +0800
commitfac0b793999fea4bb820fbb4e573ca1a516601a1 (patch)
tree6c312a3f794ea616fc0684e8e9025258f4ad671d
parenta1b0d56216fbdf5d891fff35d3ad8fd2c8a1f4a4 (diff)
add comments
-rw-r--r--xmake/core/package/package.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 0ca4dc676..d99ef2d0f 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -110,8 +110,13 @@ end
-- set the value to the package info
function _instance:set(name, ...)
if self._SOURCE_INITED then
+ -- we can use set/add to modify urls, .. in on_load() if urls have been inited.
+ -- but we cannot init urls, ... in on_load() if it has been not inited
+ --
+ -- @see https://github.com/xmake-io/xmake/issues/5148
+ -- https://github.com/xmake-io/xmake-repo/pull/4204
if self:_sourceset():has(name) and self:get(name) == nil then
- os.raise("'%s' can only be initied in on_source() or description scope.", name)
+ os.raise("'%s' can only be initied in on_source() or the description scope.", name)
end
end
self._INFO:apival_set(name, ...)
@@ -121,7 +126,7 @@ end
function _instance:add(name, ...)
if self._SOURCE_INITED then
if self:_sourceset():has(name) and self:get(name) == nil then
- os.raise("'%s' can only be initied in on_source() or description scope.", name)
+ os.raise("'%s' can only be initied in on_source() or the description scope.", name)
end
end
self._INFO:apival_add(name, ...)