From 7e9de0d25feb8e462441054e81ffe8b18b401760 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 3 Jun 2019 16:49:10 +0200 Subject: [PATCH] themes: don't reset theme on package upgrades Fixes: #2743 Signed-off-by: Jo-Philipp Wich (backported from commit 5fd071aadbcaa3b136a37fa2cbcb9799b0153e2a) --- .../etc/uci-defaults/30_luci-theme-bootstrap | 14 +++++++++----- .../uci-defaults/30_luci-theme-freifunk-generic | 16 +++++++++++----- .../root/etc/uci-defaults/30_luci-theme-material | 14 +++++++++----- .../root/etc/uci-defaults/30_luci-theme-openwrt | 15 ++++++++++----- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap b/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap index 09299e0922..b5161843fe 100755 --- a/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap +++ b/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap @@ -1,7 +1,11 @@ #!/bin/sh -uci batch <<-EOF - set luci.themes.Bootstrap=/luci-static/bootstrap - set luci.main.mediaurlbase=/luci-static/bootstrap - commit luci -EOF + +if [ "$PKG_UPGRADE" != 1 ]; then + uci batch <<-EOF + set luci.themes.Bootstrap=/luci-static/bootstrap + set luci.main.mediaurlbase=/luci-static/bootstrap + commit luci + EOF +fi + exit 0 diff --git a/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic b/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic index 017e7f7bad..2cc083564a 100644 --- a/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic +++ b/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic @@ -1,5 +1,11 @@ -uci batch <<-EOF - set luci.themes.Freifunk_Generic=/luci-static/freifunk-generic - set luci.main.mediaurlbase=/luci-static/freifunk-generic - commit luci -EOF +#!/bin/sh + +if [ "$PKG_UPGRADE" != 1 ]; then + uci batch <<-EOF + set luci.themes.Freifunk_Generic=/luci-static/freifunk-generic + set luci.main.mediaurlbase=/luci-static/freifunk-generic + commit luci + EOF +fi + +exit 0 diff --git a/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material b/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material index b01337821c..96ab461859 100755 --- a/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material +++ b/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material @@ -1,7 +1,11 @@ #!/bin/sh -uci batch <<-EOF - set luci.themes.Material=/luci-static/material - set luci.main.mediaurlbase=/luci-static/material - commit luci -EOF + +if [ "$PKG_UPGRADE" != 1 ]; then + uci batch <<-EOF + set luci.themes.Material=/luci-static/material + set luci.main.mediaurlbase=/luci-static/material + commit luci + EOF +fi + exit 0 diff --git a/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt b/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt index aa0ba0c231..77e2f6064b 100755 --- a/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt +++ b/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt @@ -1,6 +1,11 @@ #!/bin/sh -uci batch <<-EOF - set luci.themes.OpenWrt=/luci-static/openwrt.org - set luci.main.mediaurlbase=/luci-static/openwrt.org - commit luci -EOF + +if [ "$PKG_UPGRADE" != 1 ]; then + uci batch <<-EOF + set luci.themes.OpenWrt=/luci-static/openwrt.org + set luci.main.mediaurlbase=/luci-static/openwrt.org + commit luci + EOF +fi + +exit 0 -- 2.30.2