[dpdk-dev] scripts: test clean build when config have changed

Message ID 1467287137-30964-1-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Thomas Monjalon June 30, 2016, 11:45 a.m. UTC
  If there is a change in the config directory the build test
will refresh the tested build config to take into account new options.
The git working directory and the last git commit are checked for a
change in config/.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 scripts/test-build.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 1, 2016, 2:05 p.m. UTC | #1
2016-06-30 13:45, Thomas Monjalon:
> If there is a change in the config directory the build test
> will refresh the tested build config to take into account new options.
> The git working directory and the last git commit are checked for a
> change in config/.
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied
  

Patch

diff --git a/scripts/test-build.sh b/scripts/test-build.sh
index 24c0202..5bcecfc 100755
--- a/scripts/test-build.sh
+++ b/scripts/test-build.sh
@@ -130,7 +130,12 @@  reset_env ()
 
 config () # <directory> <target> <options>
 {
-	if [ ! -e $1/.config ] ; then
+	reconfig=false
+	if git rev-parse 2>&- && [ -n "$(git diff HEAD~ -- config)" ] ; then
+		echo 'Default config may have changed'
+		reconfig=true
+	fi
+	if [ ! -e $1/.config ] || $reconfig ; then
 		echo "================== Configure $1"
 		make T=$2 O=$1 config