From e4a3fd177c9ff4dc9113af22a72e930f257514ea Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 28 Mar 2009 20:15:53 +0000 Subject: [PATCH] modules/admin-full: improve opkg error reporting --- i18n/english/luasrc/i18n/admin-core.en.lua | 19 +++++++++++++++++ i18n/german/luasrc/i18n/admin-core.de.lua | 19 +++++++++++++++++ .../luasrc/view/admin_system/packages.htm | 21 +++++++++++++++---- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua index 854d388f7..558df116a 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.lua +++ b/i18n/english/luasrc/i18n/admin-core.en.lua @@ -110,6 +110,25 @@ a_s_packages_search = 'Find package' a_s_packages_update = 'Package lists updated' a_s_packages_updatelist = 'Update package lists' a_s_packages_upgrade = 'Upgrade installed packages' +a_s_packages_code1 = 'Could not set default destination' +a_s_packages_code2 = 'Error parsing config file' +a_s_packages_code3 = 'Could not create temporary directory (ran out of space?)' +a_s_packages_code4 = 'Could not get adminstrative lock (ran out of space?)' +a_s_packages_code5 = 'Unsatisfied Dependencies' +a_s_packages_code6 = 'Refused to remove essential package' +a_s_packages_code7 = 'Package has dependents' +a_s_packages_code8 = 'Package has no installation candidate (wrong name?)' +a_s_packages_code9 = 'Package has no available architecture ' +a_s_packages_code10 = 'Package is not trusted' +a_s_packages_code11 = 'Error while downloading' +a_s_packages_code12 = 'Conflicts with other packages' +a_s_packages_code13 = 'Package is already installed' +a_s_packages_code14 = 'Package has unresolved dependencies' +a_s_packages_code15 = 'Refused to downgrade package' +a_s_packages_code16 = 'Package manager ran out of space' +a_s_packages_code17 = 'Bad signature while verifiying package' +a_s_packages_code18 = 'MD5 error while verifiying package' +a_s_packages_code19 = 'Internal error occured' a_s_p_ipkg_pkglists = 'Package lists' a_s_p_ipkg_targets = 'Installation targets' a_s_changepw1 = 'Change the password of the system administrator (User root)' diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua index 970fdbe0c..28a94aaab 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.lua +++ b/i18n/german/luasrc/i18n/admin-core.de.lua @@ -80,6 +80,25 @@ a_s_packages_search = 'Paket suchen' a_s_packages_update = 'Paketlisten aktualisieren' a_s_packages_updatelist = 'Paketlisten aktualisieren' a_s_packages_upgrade = 'Installierte Pakete aktualisieren' +a_s_packages_code1 = 'Konnte das Zielverzeichnis nicht auswählen' +a_s_packages_code2 = 'Fehler beim Lesen der Konfigurationsdatei' +a_s_packages_code3 = 'Konnte kein temporäres Verzeichnis erstellen (kein Platz mehr frei?)' +a_s_packages_code4 = 'Konnte keine Lock-Datei erzeugen (kein Platz mehr frei?)' +a_s_packages_code5 = 'Ein oder mehrere Abhängigkeiten konnten nicht aufgelöst werden' +a_s_packages_code6 = 'Deinstallation von essentiellem Paket verweigert' +a_s_packages_code7 = 'Andere Pakete hängen noch von diesem Paket ab' +a_s_packages_code8 = 'Paket hat keinen Installationskandidaten (falscher Name?)' +a_s_packages_code9 = 'Paket hat keine verfügbare Architektur definiert' +a_s_packages_code10 = 'Das Paket ist nicht vertrauenswürdig' +a_s_packages_code11 = 'Fehler beim Herunterladen' +a_s_packages_code12 = 'Konflikte mit anderem Paket' +a_s_packages_code13 = 'Paket ist bereits installiert' +a_s_packages_code14 = 'Ein oder mehrere Abhängigkeiten konnten nicht aufgelöst werden' +a_s_packages_code15 = 'Installation von älterer Paketversion verweigert' +a_s_packages_code16 = 'Nicht genug verfügbarer Arbeitsspeicher' +a_s_packages_code17 = 'Kaputte Signatur beim Versuch das Paket zu verifizieren' +a_s_packages_code18 = 'Falsche Prüfsumme beim Versuch das Paket zu verifizieren' +a_s_packages_code19 = 'Interner Fehler aufgetreten' a_s_reboot1 = 'Startet das Betriebssystem des Routers neu.' a_s_reboot_do = 'Neustart durchführen' a_s_reboot_running = 'Bitte warten: Neustart wird durchgeführt...' diff --git a/modules/admin-full/luasrc/view/admin_system/packages.htm b/modules/admin-full/luasrc/view/admin_system/packages.htm index 084dab2fe..b52529ea8 100644 --- a/modules/admin-full/luasrc/view/admin_system/packages.htm +++ b/modules/admin-full/luasrc/view/admin_system/packages.htm @@ -13,11 +13,24 @@ $Id$ -%> <%- +local bit = require "bit" local rowcnt = 1 + function rowstyle() rowcnt = rowcnt + 1 return (rowcnt % 2) + 1 end + +function opkg_error(code) + code = bit.rshift(tonumber(code), 8) + return translate( + 'a_s_packages_code%i' % code, + translate( + 'a_s_packages_code%i' % code, + '%s %i' % { translate('code'), code } + ) + ) +end -%> <%+header%>

<%:system%>

@@ -28,16 +41,16 @@ end <% if install or remove or update or upgrade then %>
<%:status%>:
<% if update then %> - <%:a_s_packages_update%>: <% if update == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=update%>)<% end %>
+ <%:a_s_packages_update%>: <% if update == 0 then %><%:ok%><% else %><%:error%> (<%=opkg_error(update)%>)<% end %>
<% end %> <% if upgrade then%> - <%:a_s_packages_upgrade%>: <% if upgrade == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=upgrade%>)<% end %>
+ <%:a_s_packages_upgrade%>: <% if upgrade == 0 then %><%:ok%><% else %><%:error%> (<%=opkg_error(upgrade)%>)<% end %>
<% end %> <% if install then for k,v in pairs(install) do %> - <%:a_s_packages_install%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=v%>)<% end %>
+ <%:a_s_packages_install%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%=opkg_error(v)%>)<% end %>
<% end end %> <% if remove then for k,v in pairs(remove) do %> - <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=v%>)<% end %>
+ <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%=opkg_error(v)%>)<% end %>
<% end end %>

-- 2.25.1