diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-11-12 11:43:08 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-11-12 11:43:13 +0100 |
commit | 9fa872e6b9f69918399ced0bdb2a43226c17986f (patch) | |
tree | 231c0d408594462a57b3c5d60bfb7a6fa0b44d15 | |
parent | e3f98cf5011ece2ff527dae419a0fe677b4bb6d2 (diff) | |
download | ptxdist-9fa872e6b9f69918399ced0bdb2a43226c17986f.tar.gz ptxdist-9fa872e6b9f69918399ced0bdb2a43226c17986f.tar.xz |
ptxd_kconfig_update_config: don't use -nt or -ot
It does not handle equal timestamps or sub-second changes correctly.
Use stat to the full timestamp and just check if it changed in any way.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | scripts/lib/ptxd_lib_kconfig.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_lib_kconfig.sh b/scripts/lib/ptxd_lib_kconfig.sh index 080b2d771..bffe118e3 100644 --- a/scripts/lib/ptxd_lib_kconfig.sh +++ b/scripts/lib/ptxd_lib_kconfig.sh @@ -166,7 +166,7 @@ ptxd_kconfig_create_config_merge() { # this will be dropped, but forces kconfig to write the config echo "# ${prefix}OPTION_DOES_NOT_EXIST is not set" >> "${target}" fi - touch -r "${target}" "${target}.stamp" && + stat -c '%y' "${target}" > "${target}.stamp" && if [ "$?" -ne 0 ]; then ptxd_bailout "Failed to apply" \ "$(ptxd_print_path "${diff}")" \ @@ -404,8 +404,10 @@ ptxd_kconfig_update_config() { local target_config="${1}" local config="${2}" local base_config="${3}" + local stamp="$(stat -c '%y' "${target_config}")" + local old_stamp="$(cat "${target_config}.stamp")" - if [ ! "${target_config}" -nt "${target_config}.stamp" ]; then + if [ "${stamp}" == "${old_stamp}" ]; then rm -f "${target_config}.stamp" return fi @@ -584,7 +586,7 @@ ptxd_kconfig_update() { if [ "${part}" = ptx -o "${part}" = platform ]; then ptxd_kconfig_migrate "${part}" && # migrate touches the config, so update the timestamp - touch -r ".config" ".config.stamp" + stat -c '%y' ".config" > ".config.stamp" fi && "${conf}" "${oldconfig}" "${file_kconfig}" ;; |