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

This commit is contained in:
Matthias Schiffer 2017-01-19 13:10:57 +01:00
parent cb33d518c6
commit 0a8e028e8f
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -24,14 +24,15 @@ 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 = {}
for line in io.lines('/etc/opkg/distfeeds.conf') do
table.insert(distfeeds, line) table.insert(distfeeds, line)
end end
local f = io.open('/etc/opkg/distfeeds.conf', 'w') local f = io.open('/etc/opkg/distfeeds.conf', 'w')
for _, line in ipairs(distfeeds) do for _, line in ipairs(distfeeds) do
local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s') local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
if name == 'core' then if name == 'core' then
f:write('# ' .. line .. '\n') f:write('# ' .. line .. '\n')
@ -40,11 +41,11 @@ for _, line in ipairs(distfeeds) do
else else
f:write(line .. '\n') 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
@ -53,6 +54,7 @@ if site.opkg and site.opkg.extra and next(site.opkg.extra) then
f:close() f:close()
else else
os.remove('/etc/opkg/gluon.conf') os.remove('/etc/opkg/gluon.conf')
end
end end