diff mbox series

tests: build.sh: avoid copying .config if identical

Message ID 1602407078-Ie6126115d3e8bfe0f8aef72c50b1a3cf552fb6a5@changeid
State Accepted
Headers show
Series tests: build.sh: avoid copying .config if identical | expand

Commit Message

Johannes Berg Oct. 11, 2020, 9:04 a.m. UTC
From: Johannes Berg <johannes.berg@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@intel.com>
---
 tests/hwsim/build.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Oct. 11, 2020, 6:28 p.m. UTC | #1
On Sun, Oct 11, 2020 at 11:04:38AM +0200, Johannes Berg wrote:
> If the .config file is already identical, avoid copying
> it even if -f was specified; this improves build time if
> nothing has changed.

Thanks, applied.
diff mbox series

Patch

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