gluon-core: upgrade: don't print an error message on systems without opkg
This commit is contained in:
parent
cb33d518c6
commit
0a8e028e8f
@ -24,35 +24,37 @@ end
|
|||||||
|
|
||||||
local prefix = subst['%%n'] .. '_'
|
local prefix = subst['%%n'] .. '_'
|
||||||
|
|
||||||
local distfeeds = {}
|
if fs.access('/etc/opkg/distfeeds.conf') then
|
||||||
for line in io.lines('/etc/opkg/distfeeds.conf') do
|
local distfeeds = {}
|
||||||
table.insert(distfeeds, line)
|
for line in io.lines('/etc/opkg/distfeeds.conf') do
|
||||||
end
|
table.insert(distfeeds, line)
|
||||||
|
|
||||||
local f = io.open('/etc/opkg/distfeeds.conf', 'w')
|
|
||||||
|
|
||||||
for _, line in ipairs(distfeeds) do
|
|
||||||
local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
|
|
||||||
if name == 'core' then
|
|
||||||
f:write('# ' .. line .. '\n')
|
|
||||||
elseif name and site.opkg and site.opkg.lede then
|
|
||||||
f:write(string.format('src/gz %s %s/%s\n', prefix .. name, replace_patterns(site.opkg.lede), name))
|
|
||||||
else
|
|
||||||
f:write(line .. '\n')
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
f:close()
|
local f = io.open('/etc/opkg/distfeeds.conf', 'w')
|
||||||
|
|
||||||
if site.opkg and site.opkg.extra and next(site.opkg.extra) then
|
for _, line in ipairs(distfeeds) do
|
||||||
local f = io.open('/etc/opkg/gluon.conf', 'w')
|
local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
|
||||||
|
if name == 'core' then
|
||||||
for k, v in pairs(site.opkg.extra) do
|
f:write('# ' .. line .. '\n')
|
||||||
f:write(string.format('src/gz %s %s\n', k, replace_patterns(v)))
|
elseif name and site.opkg and site.opkg.lede then
|
||||||
|
f:write(string.format('src/gz %s %s/%s\n', prefix .. name, replace_patterns(site.opkg.lede), name))
|
||||||
|
else
|
||||||
|
f:write(line .. '\n')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
f:close()
|
f:close()
|
||||||
|
|
||||||
else
|
if site.opkg and site.opkg.extra and next(site.opkg.extra) then
|
||||||
os.remove('/etc/opkg/gluon.conf')
|
local f = io.open('/etc/opkg/gluon.conf', 'w')
|
||||||
|
|
||||||
|
for k, v in pairs(site.opkg.extra) do
|
||||||
|
f:write(string.format('src/gz %s %s\n', k, replace_patterns(v)))
|
||||||
|
end
|
||||||
|
|
||||||
|
f:close()
|
||||||
|
|
||||||
|
else
|
||||||
|
os.remove('/etc/opkg/gluon.conf')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user