[PATCH] tests: build.sh: avoid copying .config if identical

Johannes Berg johannes at sipsolutions.net
Sun Oct 11 05:04:38 EDT 2020


From: Johannes Berg <johannes.berg at intel.com>

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 <johannes.berg at intel.com>
---
 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 d8a78d705ab3..2a3dd706ebf9 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
-- 
2.26.2




More information about the Hostap mailing list