openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgr...@apache.org
Subject [incubator-openwhisk-release] branch master updated: Small enhancements to rcverify.sh (#283)
Date Tue, 28 May 2019 13:41:28 GMT
This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-release.git


The following commit(s) were added to refs/heads/master by this push:
     new 38e5c15  Small enhancements to rcverify.sh (#283)
38e5c15 is described below

commit 38e5c15a9f3405f30ad88b5594618aa27d7b9019
Author: David Grove <dgrove-oss@users.noreply.github.com>
AuthorDate: Tue May 28 09:41:23 2019 -0400

    Small enhancements to rcverify.sh (#283)
    
    1. Support LICENSE.txt files which append license
       summaries of bundled dependencies per [1].
    2. Support project-specific scancode exclusion file
       (by convention located in tools/travis/scancodeExclusions.
    
    [1] http://www.apache.org/dev/licensing-howto.html#bundled-vs-non-bundled
---
 tools/rcverify.sh | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/tools/rcverify.sh b/tools/rcverify.sh
index a0bd0cc..accf5f5 100755
--- a/tools/rcverify.sh
+++ b/tools/rcverify.sh
@@ -139,16 +139,24 @@ printf "verifing notice..."
 NTXT=$(cat "$DIR/$BASE/NOTICE.txt")
 validate "$NOTICE" "$NTXT" "cat '$DIR/$BASE/NOTICE.txt'"
 
+# If a project bundles any dependencies, there will be additional
+# text appended to LICENSE.txt to summarize the additional licenses.
+# Therefore only enforce a prefix match between the project's
+# LICENSE.txt and the official text of the Apache LICENSE-2.0.
 printf "verifying license..."
 curl http://www.apache.org/licenses/LICENSE-2.0 -s -o "$DIR/LICENSE-2.0"
-## this is a more forgiving license check that allows for the copyright line to be filled
out
-#CMD="diff '$DIR/$BASE/LICENSE.txt' '$DIR/LICENSE-2.0' -I '^   Copyright'"
-CMD="diff '$DIR/$BASE/LICENSE.txt' '$DIR/LICENSE-2.0'"
-DIF=$(eval "$CMD")
+LICENSE_LEN=$(wc -c "$DIR/LICENSE-2.0" | awk '{print $1}')
+CMD="cmp -n $LICENSE_LEN '$DIR/LICENSE-2.0' '$DIR/$BASE/LICENSE.txt'"
+CMP=$(eval "$CMD")
 validate $? 0 "$CMD"
 
 printf "verifying sources have proper headers..."
-CMD="'$DIR/incubator-openwhisk-utilities/scancode/scanCode.py' --config '$DIR/incubator-openwhisk-utilities/scancode/ASF-Release.cfg'
'$DIR/$BASE'"
+if [ -f '$DIR/$BASE/tools/travis/scancodeExlusions' ]; then
+    SCANCODE_EXTRA_ARGS="--gitignore '$DIR/$BASE/tools/travis/scancodeExclusions'"
+else
+    SCANCODE_EXTRA_ARGS=""
+fi
+CMD="'$DIR/incubator-openwhisk-utilities/scancode/scanCode.py' --config '$DIR/incubator-openwhisk-utilities/scancode/ASF-Release.cfg'
$SCANCODE_EXTRA_ARGS '$DIR/$BASE'"
 SC=$(eval $CMD >& /dev/null)
 validate $? 0 "$CMD"
 


Mime
View raw message