diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-12-12 11:03:19 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-12-12 11:03:21 +0100 |
commit | 1ee6f3a8f58cbd97de2bc163536eac961a3dd891 (patch) | |
tree | 836c4d06be75ddefd6025281329a6403873f2045 /scripts | |
parent | 612efba41f61ff929fa145b820fa58b2ef67299e (diff) | |
download | ptxdist-1ee6f3a8f58cbd97de2bc163536eac961a3dd891.tar.gz ptxdist-1ee6f3a8f58cbd97de2bc163536eac961a3dd891.tar.xz |
ptxd_make_kconfig_sync: fix handling config changes
Update the config for any *config make targets (unchanged).
For anything else, update only in interactive sessions (= when a tty is
available). Otherwise fail if the config changes.
This emulates the old 'silentoldconfig' mode that no longer exists in the
kernel.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_world_kconfig.sh | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/scripts/lib/ptxd_make_world_kconfig.sh b/scripts/lib/ptxd_make_world_kconfig.sh index 42eca81c1..8c8de302f 100644 --- a/scripts/lib/ptxd_make_world_kconfig.sh +++ b/scripts/lib/ptxd_make_world_kconfig.sh @@ -8,6 +8,16 @@ # see the README file. # +ptxd_make_world_kconfig_mode() { + if [ -z "${ptx_config_mode}" ]; then + case "${pkg_stage}" in + *config) ptx_config_mode=update ;; + *) ptx_config_mode=run ;; + esac + fi +} +export -f ptxd_make_world_kconfig_mode + ptxd_make_kconfig_setup() { if [ -n "${ref_file_dotconfig}" ]; then file_dotconfig="${ref_file_dotconfig}" ptxd_normalize_config && @@ -22,32 +32,28 @@ export -f ptxd_make_kconfig_setup ptxd_make_world_kconfig_setup() { ptxd_make_world_init || return - if [ -z "${ptx_config_mode}" ]; then - case "${pkg_stage}" in - *config) ptx_config_mode=update ;; - *) ptx_config_mode=run ;; - esac - fi - local file_dotconfig="${pkg_config}" local ref_file_dotconfig="${pkg_ref_config}" + ptxd_make_world_kconfig_mode && ptxd_make_kconfig_setup } export -f ptxd_make_world_kconfig_setup ptxd_make_kconfig_sync() { local mode - if [ -n "${PTXDIST_QUIET}" -a "${1}" = oldconfig ]; then - mode=check - else - mode=update + if [ "${ptx_config_mode}" = run ]; then + if tty -s; then + ptx_config_mode=update + else + ptx_config_mode=check + fi fi if [ -n "${ref_file_dotconfig}" ]; then file_dotconfig="${ref_file_dotconfig}" ptxd_normalize_config && relative_ref_file_dotconfig="${relative_file_dotconfig}" fi && ptxd_normalize_config && - ptxd_kconfig_sync_config "${mode}" "${pkg_build_dir}/.config" \ + ptxd_kconfig_sync_config "${ptx_config_mode}" "${pkg_build_dir}/.config" \ "${relative_file_dotconfig}" "${file_dotconfig}" "${relative_ref_file_dotconfig}" } export -f ptxd_make_kconfig_sync @@ -57,6 +63,7 @@ ptxd_make_world_kconfig_sync() { local file_dotconfig="${pkg_config}" local ref_file_dotconfig="${pkg_ref_config}" + ptxd_make_world_kconfig_mode && ptxd_make_kconfig_sync } export -f ptxd_make_world_kconfig_sync @@ -69,15 +76,9 @@ ptxd_make_kconfig() { local file_dotconfig="${pkg_config}" local ref_file_dotconfig="${pkg_ref_config}" - if [ -z "${ptx_config_mode}" ]; then - case "${pkg_stage}" in - *config) ptx_config_mode=update ;; - *) ptx_config_mode=run ;; - esac - fi - export KCONFIG_NOTIMESTAMP="1" + ptxd_make_world_kconfig_mode && ptxd_make_kconfig_setup && ptxd_eval \ "${pkg_path}" \ @@ -85,7 +86,7 @@ ptxd_make_kconfig() { "${pkg_conf_env}" \ make "${1}" \ "${pkg_conf_opt}" && - ptxd_make_kconfig_sync "${1}" + ptxd_make_kconfig_sync } export -f ptxd_make_kconfig |