-for file in $(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:.*<strong>\(.*\)</strong>.*:\1:p' |xargs)
- result=$(echo $licnse | grep "$RE")
- if [ -n "$result" ]; then
- # possibly we have exceeded the post rate
- sleep 10
- 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:.*<strong>\(.*\)</strong>.*:\1:p' |xargs)
+ if $binary ; then
+ license=Binary
+ else
+ license="No Apache license found"
+ if [ -f $file ]; then
+ if [ -s $file ]; then
+ if [ $(grep -c "http://www.apache.org/licenses/LICENSE-2.0" $file) -ge 1 ] ; then
+ license="Apache-2.0"
+ fi