From e1562181da2cc6767c1e59bfb69899c67d888a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz> Date: Mon, 19 Aug 2019 14:40:29 +0200 Subject: [PATCH] lists: fix problems with not removed luci applications This reverts to previous approach for Luci localization packages. It introduces back problems that language packages are installed only to apps introduced by updater lists but there is no way around it. This implementation was problematic as it kept installed packages in place because of language packages depending on package that was suppose to be removed. This meant that such package was hold in place by language package that was in turn hold in place by information that parent package is installed. It created cycle that updater was not able to break (only opkg). This fixes this issue. --- lists/luci-utils.m4 | 17 ++++ lists/luci.lua.m4 | 124 ++-------------------------- lists/pkglists/3g.lua.m4 | 3 +- lists/pkglists/luci-controls.lua.m4 | 8 +- lists/pkglists/lxc.lua.m4 | 3 +- lists/pkglists/nas.lua.m4 | 3 +- lists/pkglists/printserver.lua.m4 | 3 +- 7 files changed, 34 insertions(+), 127 deletions(-) create mode 100644 lists/luci-utils.m4 diff --git a/lists/luci-utils.m4 b/lists/luci-utils.m4 new file mode 100644 index 000000000..a3af0f16c --- /dev/null +++ b/lists/luci-utils.m4 @@ -0,0 +1,17 @@ + +local function luci_app(...) + for app in pairs(...) do + Install("luci-app-" .. app, { priority = 40 }) + if for_l10n then + Install("luci-i18n-" .. app .. "-en", { optional = true }) + for_l10n("luci-i18n-" .. app .. "-") + end + end +end + +local function luci_proto(...) + for proto in pairs(...) do + Install("luci-proto-" .. proto, { priority = 40 }) + end +end + diff --git a/lists/luci.lua.m4 b/lists/luci.lua.m4 index 9cb4a0f77..2ef0f7126 100644 --- a/lists/luci.lua.m4 +++ b/lists/luci.lua.m4 @@ -1,128 +1,14 @@ include(utils.m4)dnl Include utility macros +include(luci-utils.m4)dnl _FEATURE_GUARD_ -Install("luci", "luci-lighttpd", { priority = 40 }) -forInstall(luci,base,proto-ipv6,proto-ppp,app-commands) - - ---[[ -All packages with localization packages -Generated using: - curl https://repo.turris.cz/hbd/omnia/packages/luci/Packages | sed -n '/Package: luci-i18n-/,/^$/{ s/Depends:.*luci-app-\([^ ,]\+\).*/\1/p }' | sort | uniq | sed 's/^/"/;s/$/",/' -]] -local luci_apps = { - "adblock", - "advanced-reboot", - "ahcp", - "aria2", - "bcp38", - "clamav", - "commands", - "ddns", - "diag-core", - "dnscrypt-proxy", - "dynapoint", - "firewall", - "fwknopd", - "hd-idle", - "https_dns_proxy", - "minidlna", - "mjpg-streamer", - "mwan3", - "nft-qos", - "nlbwmon", - "noddos", - "ntpc", - "nut", - "olsr", - "openvpn", - "opkg", - "p910nd", - "pagekitec", - "polipo", - "privoxy", - "qos", - "radicale", - "radicale2", - "rp-pppoe-server", - "samba", - "samba4", - "shadowsocks-libev", - "shairplay", - "simple-adblock", - "splash", - "statistics", - "tinyproxy", - "transmission", - "travelmate", - "uhttpd", - "unbound", - "upnp", - "vnstat", - "vpnbypass", - "watchcat", - "wifischedule", - "wireguard", - "wol", -} - ---[[ -Some packages have separate EN support. This is only few packages so we list them -instead of having warning for multiple packages missing. -Generated using: - curl https://repo.turris.cz/hbd/omnia/packages/luci/Packages | sed -n 's/^Package: luci-i18n-\(.*\)-en.*/\1/p' | sort | sed 's/^/["/;s/$/"] = true,/' -]] -local luci_i18n_en = { - ["ahcp"] = true, - ["base"] = true, - ["commands"] = true, - ["diag-core"] = true, - ["firewall"] = true, - ["fwknopd"] = true, - ["hd-idle"] = true, - ["minidlna"] = true, - ["ntpc"] = true, - ["nut"] = true, - ["olsr"] = true, - ["openvpn"] = true, - ["opkg"] = true, - ["p910nd"] = true, - ["polipo"] = true, - ["qos"] = true, - ["radicale2"] = true, - ["rp-pppoe-server"] = true, - ["samba"] = true, - ["samba4"] = true, - ["splash"] = true, - ["statistics"] = true, - ["tinyproxy"] = true, - ["transmission"] = true, - ["uhttpd"] = true, - ["upnp"] = true, - ["vnstat"] = true, - ["watchcat"] = true, - ["wol"] = true, -} - +Install("luci", "luci-base", "luci-lighttpd", { priority = 40 }) if for_l10n then Install("luci-i18n-base-en", { optional = true }) for_l10n("luci-i18n-base-") - - for _, app in pairs(luci_apps) do - if installed["luci-app-" .. app] then - if luci_i18n_en[app] then - Install("luci-i18n-" .. app .. "-en", { optional = true }) - end - for_l10n("luci-i18n-" .. app .. "-") - else - --[[ - We are not aware that we should install i18n unless it is installed - already so we instead request replan on finish to install missing i18n - packages. - ]] - Package("luci-app-" .. app, { replan = "finished"}) - end - end end +luci_app("commands") +luci_proto("ipv6", "ppp") + _END_FEATURE_GUARD_ diff --git a/lists/pkglists/3g.lua.m4 b/lists/pkglists/3g.lua.m4 index edf918d28..4ff3b6a71 100644 --- a/lists/pkglists/3g.lua.m4 +++ b/lists/pkglists/3g.lua.m4 @@ -1,4 +1,5 @@ include(utils.m4)dnl Include utility macros +include(luci-utils.m4)dnl _FEATURE_GUARD_ -- 3G @@ -10,6 +11,6 @@ Install("usb-modeswitch", { priority = 40 }) forInstall(kmod,nf-nathelper-extra,usb-net-rndis,usb-net-qmi-wwan,usb-serial-option,usb-serial-qualcomm) -- Luci -Install("luci-proto-3g", { priority = 40 }) +luci_proto("3g") _END_FEATURE_GUARD_ diff --git a/lists/pkglists/luci-controls.lua.m4 b/lists/pkglists/luci-controls.lua.m4 index d45a6f1d4..86c9f57d7 100644 --- a/lists/pkglists/luci-controls.lua.m4 +++ b/lists/pkglists/luci-controls.lua.m4 @@ -1,11 +1,11 @@ include(utils.m4)dnl Include utility macros +include(luci-utils.m4)dnl _FEATURE_GUARD_ -forInstall(luci-app,ahcp,adblock,bcp38,firewall,minidlna,mjpg-streamer,sqm,statistics,tinyproxy,transmission,upnp) -forInstall(luci-proto,openconnect,relay,vpnc) -Install("luci-theme-bootstrap", { priority = 40 }) +luci_app("ahcp", "adblock", "bcp38", "firewall", "minidlna", "mjpg-streamer", "sqm", "statistics", "tinyproxy", "transmission", "upnp") if board == "omnia" or board == "turris1x" then - Install('luci-app-rainbow', { priority = 40 }) + luci_app('rainbow') end +luci_proto("openconnect", "relay", "vpnc") _END_FEATURE_GUARD_ diff --git a/lists/pkglists/lxc.lua.m4 b/lists/pkglists/lxc.lua.m4 index 793cdd737..55d4873cb 100644 --- a/lists/pkglists/lxc.lua.m4 +++ b/lists/pkglists/lxc.lua.m4 @@ -1,10 +1,11 @@ include(utils.m4)dnl Include utility macros +include(luci-utils.m4)dnl _FEATURE_GUARD_ Install("lxc", { priority = 40 }) forInstall(lxc,attach,auto,console,copy,create,destroy,freeze,info,ls,monitor,monitord,snapshot,start,stop,unfreeze) -Install("luci-app-lxc", { priority = 40 }) +luci_app("lxc") Install("kmod-veth", { priority = 40 }) Install("gnupg", "gnupg-utils", "getopt", "tar", "wget", { priority = 40 }) diff --git a/lists/pkglists/nas.lua.m4 b/lists/pkglists/nas.lua.m4 index 528fa2656..d56174cfe 100644 --- a/lists/pkglists/nas.lua.m4 +++ b/lists/pkglists/nas.lua.m4 @@ -1,4 +1,5 @@ include(utils.m4)dnl Include utility macros +include(luci-utils.m4)dnl _FEATURE_GUARD_ -- Kernel -- @@ -35,7 +36,7 @@ Install("sshfs", { priority = 40 }) Install("wget", "rsync", "rsyncd", "samba36-client", "samba36-server", { priority = 40 }) -- Luci -forInstall(luci-app,hd-idle,minidlna,samba) +luci_app("hd-idle","minidlna", "samba") Install("luci-mod-admin-full", { priority = 40 }) -- Encryption -- diff --git a/lists/pkglists/printserver.lua.m4 b/lists/pkglists/printserver.lua.m4 index 6cecc2ae8..9c26145bd 100644 --- a/lists/pkglists/printserver.lua.m4 +++ b/lists/pkglists/printserver.lua.m4 @@ -1,10 +1,11 @@ include(utils.m4)dnl Include utility macros +include(luci-utils.m4)dnl _FEATURE_GUARD_ -- Kernel Install("kmod-usb-printer", { priority = 40 }) -- Luci -Install("luci-app-p910nd", { priority = 40 }) +luci_app("p910nd") _END_FEATURE_GUARD_ -- GitLab