aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-06-19 11:02:01 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-07-01 15:51:13 -0300
commit10ee65ec23a9b107c712bd7b017083c9a5571b0c (patch)
tree551d289947203033454906929929baffb82e014e /src
parentbf14d8cf45bab9a43b00672cd452d138a8726dfc (diff)
downloadluarocks-10ee65ec23a9b107c712bd7b017083c9a5571b0c.tar.gz
luarocks-10ee65ec23a9b107c712bd7b017083c9a5571b0c.tar.bz2
luarocks-10ee65ec23a9b107c712bd7b017083c9a5571b0c.zip
queries: delay initalization of default [arch] entry
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/queries.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/queries.lua b/src/luarocks/queries.lua
index 99728103..92d76460 100644
--- a/src/luarocks/queries.lua
+++ b/src/luarocks/queries.lua
@@ -19,7 +19,7 @@ query_mt.arch = {
19 all = true, 19 all = true,
20 rockspec = true, 20 rockspec = true,
21 installed = true, 21 installed = true,
22 [cfg.arch] = true, 22 -- [cfg.arch] = true, -- this is set later
23} 23}
24 24
25-- Fallback default value for the `substring` field, if not explicitly set. 25-- Fallback default value for the `substring` field, if not explicitly set.
@@ -68,6 +68,8 @@ function queries.new(ns_name, version, substring, arch, operator)
68 if version then 68 if version then
69 table.insert(self.constraints, { op = operator, version = vers.parse_version(version)}) 69 table.insert(self.constraints, { op = operator, version = vers.parse_version(version)})
70 end 70 end
71
72 query_mt.arch[cfg.arch] = true
71 return setmetatable(self, query_mt) 73 return setmetatable(self, query_mt)
72end 74end
73 75
@@ -170,11 +172,14 @@ do
170 namespace = namespace, 172 namespace = namespace,
171 constraints = constraints, 173 constraints = constraints,
172 } 174 }
175
176 query_mt.arch[cfg.arch] = true
173 return setmetatable(self, query_mt) 177 return setmetatable(self, query_mt)
174 end 178 end
175end 179end
176 180
177function queries.from_persisted_table(tbl) 181function queries.from_persisted_table(tbl)
182 query_mt.arch[cfg.arch] = true
178 return setmetatable(tbl, query_mt) 183 return setmetatable(tbl, query_mt)
179end 184end
180 185