Skip to content
Snippets Groups Projects
Unverified Commit 0a8e028e authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: upgrade: don't print an error message on systems without opkg

parent cb33d518
No related branches found
No related tags found
No related merge requests found
...@@ -24,35 +24,37 @@ end ...@@ -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)
end
local f = io.open('/etc/opkg/distfeeds.conf', 'w')
for _, line in ipairs(distfeeds) do local f = io.open('/etc/opkg/distfeeds.conf', 'w')
local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
if name == 'core' then for _, line in ipairs(distfeeds) do
f:write('# ' .. line .. '\n') local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
elseif name and site.opkg and site.opkg.lede then if name == 'core' then
f:write(string.format('src/gz %s %s/%s\n', prefix .. name, replace_patterns(site.opkg.lede), name)) f:write('# ' .. line .. '\n')
else elseif name and site.opkg and site.opkg.lede then
f:write(line .. '\n') 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
end
f:close() f:close()
if site.opkg and site.opkg.extra and next(site.opkg.extra) then if site.opkg and site.opkg.extra and next(site.opkg.extra) then
local f = io.open('/etc/opkg/gluon.conf', 'w') local f = io.open('/etc/opkg/gluon.conf', 'w')
for k, v in pairs(site.opkg.extra) do for k, v in pairs(site.opkg.extra) do
f:write(string.format('src/gz %s %s\n', k, replace_patterns(v))) f:write(string.format('src/gz %s %s\n', k, replace_patterns(v)))
end end
f:close() f:close()
else else
os.remove('/etc/opkg/gluon.conf') os.remove('/etc/opkg/gluon.conf')
end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment