X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tools%2Flicense_scan.sh;h=71d283fbff588b92cad4747d4aedab40e7208c87;hb=d081690f8603c9c7d1534cb8c0c01bf23de1d086;hp=7bfee6f4ebaa9178af9003dabaa88c4a629c0413;hpb=ff53f35303d2a99e5c2aa31619e1b12aff9b2fad;p=osm%2Fdevops.git diff --git a/tools/license_scan.sh b/tools/license_scan.sh index 7bfee6f4..71d283fb 100755 --- a/tools/license_scan.sh +++ b/tools/license_scan.sh @@ -29,12 +29,12 @@ dpkg -l curl &>/dev/null ||sudo apt-get install -y curl apache=0 nolicense=0 other=0 - +exception_list="':(exclude)*.pdf' ':(exclude)*.png' ':(exclude)*.jpeg' ':(exclude)*.jpg' ':(exclude)*.gif' ':(exclude)*.json'" git fetch RE="FATAL: your file did not get passed through" -for file in $(git diff --name-only origin/$GERRIT_BRANCH -- . ':!*.pdf' ':!*.png' ':!*.jp[e]?g' ':!*.gif' ':!*.json'); do +for file in $(echo ${exception_list} | xargs git diff --name-only origin/$GERRIT_BRANCH -- . ); 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)