]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: build.sh: Avoid copying .config if identical
authorJohannes Berg <johannes.berg@intel.com>
Sun, 11 Oct 2020 09:04:38 +0000 (11:04 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Oct 2020 16:42:52 +0000 (19:42 +0300)
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@intel.com>
tests/hwsim/build.sh

index d8a78d705ab3ce88aa47ebb5124f1d7571c61713..2a3dd706ebf97fecd6d579d0c8f4a9f58124d52c 100755 (executable)
@@ -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