From 5a2e2cda268f6d80a80d8dcb1a80914bc1db60e2 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 15 Aug 2019 13:46:12 -0700 Subject: [PATCH 1/2] Show all license diffs Instead of gathering all license diffs but only showing the changes to the first directory that has a diff, show all diffs before exiting licenses.sh. Fixes https://github.com/flutter/flutter/issues/38634 --- ci/licenses.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ci/licenses.sh b/ci/licenses.sh index eed3fb42ec7a6..92d88448ea92b 100755 --- a/ci/licenses.sh +++ b/ci/licenses.sh @@ -5,6 +5,8 @@ shopt -s nullglob echo "Verifying license script is still happy..." echo "Using pub from `which pub`, dart from `which dart`" +exitStatus=0 + dart --version (cd flutter/tools/licenses; pub get; dart --enable-asserts lib/main.dart --src ../../.. --out ../../../out/license_script_output --golden ../../ci/licenses_golden) @@ -22,7 +24,9 @@ for f in out/license_script_output/licenses_*; do echo " https://github.com/flutter/engine/tree/master/tools/licenses" echo "" diff -U 6 flutter/ci/licenses_golden/$(basename $f) $f - exit 1 + echo "=================================================================" + echo "" + exitStatus=1 fi done @@ -41,7 +45,9 @@ then echo " https://github.com/flutter/engine/tree/master/tools/licenses" echo "" diff -U 6 flutter/ci/licenses_golden/tool_signature out/license_script_output/tool_signature - exit 1 + echo "=================================================================" + echo "" + exitStatus=1 fi echo "Checking license count in licenses_flutter..." @@ -60,8 +66,10 @@ then echo "Files in 'third_party/txt' may have an Apache license header instead." echo "If you're absolutely sure that the change in license count is" echo "intentional, update 'flutter/ci/licenses.sh' with the new count." - exit 1 + echo "=================================================================" + echo "" + exitStatus=1 fi echo "Licenses are as expected." -exit 0 +exit $exitStatus From fb31de969e7797c6327b8fef6ff403af4483aec3 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 19 Aug 2019 09:23:38 -0700 Subject: [PATCH 2/2] Only output 'as expected' message for non-failure cases --- ci/licenses.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/licenses.sh b/ci/licenses.sh index 92d88448ea92b..d411c875bf845 100755 --- a/ci/licenses.sh +++ b/ci/licenses.sh @@ -71,5 +71,8 @@ then exitStatus=1 fi -echo "Licenses are as expected." +if [ "$exitStatus" -eq "0" ] +then + echo "Licenses are as expected." +fi exit $exitStatus