summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2023-10-27 17:09:28 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2023-10-28 15:45:52 +0200
commitde5bed118c974f67b64798aa569f5fa3210edc59 (patch)
tree1c4cd0c9664b61c7ad041bb78c08b3943e43e019 /scripts/lib
parent8654386a14ea93854052fa4aa4fd3333a01a1efb (diff)
downloadptxdist-de5bed118c974f67b64798aa569f5fa3210edc59.tar.gz
ptxdist-de5bed118c974f67b64798aa569f5fa3210edc59.tar.xz
ptxd_kconfig_update: potentially run migrate for all*config
'ptxdist all*config ...' can be used to set all new symbols to a certain value by setting KCONFIG_ALLCONFIG to the used ptxconfig. In that case, run migrate to update the existing symbols. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/ptxd_lib_kconfig.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_lib_kconfig.sh b/scripts/lib/ptxd_lib_kconfig.sh
index 118deb421..bc649643f 100644
--- a/scripts/lib/ptxd_lib_kconfig.sh
+++ b/scripts/lib/ptxd_lib_kconfig.sh
@@ -15,14 +15,15 @@
#
ptxd_kconfig_migrate() {
local part="${1}"
+ local config="${2-.config}"
local assistant="${PTX_MIGRATEDIR}/migrate_${part}"
if [ \! -f "${assistant}" ]; then
return 0
fi
- cp -- ".config" ".config.old" || return
- sed -f "${assistant}" ".config.old" > ".config"
+ cp -- "${config}" "${config}.old" || return
+ sed -f "${assistant}" "${config}.old" > "${config}"
retval=$?
if [ $retval -ne 0 ]; then
@@ -30,7 +31,7 @@ ptxd_kconfig_migrate() {
return ${retval}
fi
- if ! diff -u ".config.old" ".config" >/dev/null; then
+ if ! diff -u "${config}.old" "${config}" >/dev/null; then
ptxd_dialog_msgbox "info: successfully migrated '${file_dotconfig}'"
fi
@@ -700,6 +701,9 @@ ptxd_kconfig_update() {
ptxd_kconfig_run_conf --oldconfig "${file_kconfig}" < /dev/null > /dev/null
;;
all*config|randconfig)
+ if [ "$(realpath "${KCONFIG_ALLCONFIG}")" = "$(realpath "${file_dotconfig}")" ]; then
+ ptxd_kconfig_migrate "${part}" "${file_dotconfig}"
+ fi &&
ptxd_kconfig_run_conf --${config} "${file_kconfig}"
;;
dep)