From 7c1f73434953ceaad90c428f315b27d9bdae6225 Mon Sep 17 00:00:00 2001 From: madavi Date: Wed, 4 Sep 2019 11:58:38 +0530 Subject: [PATCH] License check exceptions for master branch Change-Id: I9f1fea4d8943380967058797338fc7772dbb0a06 Signed-off-by: madavi --- tools/license_scan.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/license_scan.sh b/tools/license_scan.sh index 2c5fb4a7..7bfee6f4 100755 --- a/tools/license_scan.sh +++ b/tools/license_scan.sh @@ -18,7 +18,7 @@ # Change log: # 1. Bug 722 : Jayant Madavi : JM00553988@techmahindra.com : Enhancement to use new fossology server. Had to change the variable name at # couple of places, while scanning the variable name was adding curl as a license. # 2. Bug 542 : Jayant Madavi, Mrityunjay Yadav : JM00553988@techmahindra.com : 24-jul-2019 : Enhancement to raise exit in case files modified or added does # not contain license. -# 3. +# 3. Bug 542 : Jayant Madavi, Mrityunjay Yadav : JM00553988@techmahindra.com :add exception list. for now as inLine. later need to create a variable for exception_list echo GERRIT BRANCH is $GERRIT_BRANCH dpkg -l wget &>/dev/null ||sudo apt-get install -y wget @@ -34,7 +34,7 @@ git fetch RE="FATAL: your file did not get passed through" -for file in $(git diff --name-only origin/$GERRIT_BRANCH); do +for file in $(git diff --name-only origin/$GERRIT_BRANCH -- . ':!*.pdf' ':!*.png' ':!*.jp[e]?g' ':!*.gif' ':!*.json'); do if [ -f $file ]; then if [ -s $file ]; then licnse=$(curl -s -X POST -H 'Accept: text' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' -H 'Content-Type: multipart/form-data' -H 'cache-control: no-cache' -F "file_input=@\"$file\"" -F 'showheader=1' https://fossology-osm.etsi.org/?mod=agent_nomos_once |grep "A one shot license analysis shows the following license(s) in file"|sed -n 's:.*\(.*\).*:\1:p' |xargs) -- 2.17.1