From 5c7a048e451bed3bf34824e4d1be2b90689fdb9e Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sun, 11 Oct 2020 11:04:38 +0200 Subject: [PATCH] tests: build.sh: Avoid copying .config if identical If the .config file is already identical, avoid copying it even if -f was specified; this improves build time if nothing has changed. Signed-off-by: Johannes Berg --- tests/hwsim/build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/build.sh b/tests/hwsim/build.sh index d8a78d705..2a3dd706e 100755 --- a/tests/hwsim/build.sh +++ b/tests/hwsim/build.sh @@ -41,7 +41,9 @@ make QUIET=1 CONFIG_NO_BROWSER=1 echo "Building hostapd" cd ../../hostapd if [ ! -e .config -o $force_config -eq 1 ]; then - cp ../tests/hwsim/example-hostapd.config .config + if ! cmp ../tests/hwsim/example-hostapd.config .config >/dev/null 2>&1 ; then + cp ../tests/hwsim/example-hostapd.config .config + fi fi if [ $use_lcov -eq 1 ]; then @@ -57,7 +59,9 @@ make QUIET=1 -j8 hostapd hostapd_cli hlr_auc_gw echo "Building wpa_supplicant" cd ../wpa_supplicant if [ ! -e .config -o $force_config -eq 1 ]; then - cp ../tests/hwsim/example-wpa_supplicant.config .config + if ! cmp ../tests/hwsim/example-wpa_supplicant.config .config >/dev/null 2>&1 ; then + cp ../tests/hwsim/example-wpa_supplicant.config .config + fi fi if [ $use_lcov -eq 1 ]; then