Apache DataFusion SQL Query Engine
ARROW-336: Run Apache Rat in Travis builds
Uwe L. Kornd6738e00c83e
diff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.shindex c3bd3b5f20..d555cab3e6 100755--- a/ci/travis_script_cpp.sh+++ b/ci/travis_script_cpp.sh@@ -16,6 +16,10 @@ set -e: ${CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp-build}+# Check licenses according to Apache policy+git archive HEAD -o arrow-src.tar.gz+./dev/release/run-rat.sh arrow-src.tar.gz+pushd $CPP_BUILD_DIRmake lintdiff --git a/dev/release/02-source.sh b/dev/release/02-source.shindex 1bbe2e9275..bdaa5cc934 100644--- a/dev/release/02-source.sh+++ b/dev/release/02-source.sh@@ -7,9 +7,9 @@# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with the License. You may obtain a copy of the License at-#+## http://www.apache.org/licenses/LICENSE-2.0-#+## Unless required by applicable law or agreed to in writing,# software distributed under the License is distributed on an# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY@@ -18,6 +18,8 @@# under the License.#+SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"+if [ -z "$1" ]; thenecho "Usage: $0 <version> <rc-num>"exit@@ -56,36 +58,7 @@ tarball=$tag.tar.gz# archive (identical hashes) using the scm taggit archive $release_hash --prefix $tag/ -o $tarball-# download apache rat-curl -s https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.12/apache-rat-0.12.jar > apache-rat-0.12.jar--RAT="java -jar apache-rat-0.12.jar -d "--# generate the rat report-$RAT $tarball \- -e ".*" \- -e mman.h \- -e "*_generated.h" \- -e random.h \- -e status.cc \- -e status.h \- -e asan_symbolize.py \- -e cpplint.py \- -e FindPythonLibsNew.cmake \- -e pax_global_header \- -e MANIFEST.in \- -e __init__.pxd \- -e __init__.py \- -e requirements.txt \- > rat.txt-UNAPPROVED=`cat rat.txt | grep "Unknown Licenses" | head -n 1 | cut -d " " -f 1`--if [ "0" -eq "${UNAPPROVED}" ]; then- echo "No unnaproved licenses"-else- echo "${UNAPPROVED} unapproved licences. Check rat report: rat.txt"- exit-fi+${SOURCE_DIR}/run-rat.sh $tarball# sign the archivegpg --armor --output ${tarball}.asc --detach-sig $tarballdiff --git a/dev/release/run-rat.sh b/dev/release/run-rat.shnew file mode 100755index 0000000000..d8ec6507fc--- /dev/null+++ b/dev/release/run-rat.sh@@ -0,0 +1,53 @@+#!/bin/bash+#+# Licensed to the Apache Software Foundation (ASF) under one+# or more contributor license agreements. See the NOTICE file+# distributed with this work for additional information+# regarding copyright ownership. The ASF licenses this file+# to you under the Apache License, Version 2.0 (the+# "License"); you may not use this file except in compliance+# with the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing,+# software distributed under the License is distributed on an+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY+# KIND, either express or implied. See the License for the+# specific language governing permissions and limitations+# under the License.+#++# download apache rat+curl -s https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.12/apache-rat-0.12.jar > apache-rat-0.12.jar++RAT="java -jar apache-rat-0.12.jar -d "++# generate the rat report+$RAT $1 \+ -e ".*" \+ -e mman.h \+ -e "*_generated.h" \+ -e random.h \+ -e status.cc \+ -e status.h \+ -e asan_symbolize.py \+ -e cpplint.py \+ -e FindPythonLibsNew.cmake \+ -e pax_global_header \+ -e MANIFEST.in \+ -e __init__.pxd \+ -e __init__.py \+ -e requirements.txt \+ > rat.txt+cat rat.txt+UNAPPROVED=`cat rat.txt | grep "Unknown Licenses" | head -n 1 | cut -d " " -f 1`++if [ "0" -eq "${UNAPPROVED}" ]; then+ echo "No unnaproved licenses"+else+ echo "${UNAPPROVED} unapproved licences. Check rat report: rat.txt"+ exit 1+fi++