Repository: arrow
Updated Branches:
  refs/heads/master 4ecf32763 -> 8520061d3


ARROW-336: Run Apache Rat in Travis builds

@julienledem Integrated the rat call in the cpp build. It should fail if 
licenses are not matching. We could also make a separate `lint` Travis build 
but for the moment this seemed overkill to me.

Author: Uwe L. Korn <uw...@xhochy.com>

Closes #174 from xhochy/ARROW-336 and squashes the following commits:

25f797c [Uwe L. Korn] Make run-rat executable
6b6221f [Uwe L. Korn] ARROW-336: Run Apache Rat in Travis builds


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/8520061d
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/8520061d
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/8520061d

Branch: refs/heads/master
Commit: 8520061d38c4aa407ac6453aff786833efa5cbaa
Parents: 4ecf327
Author: Uwe L. Korn <uw...@xhochy.com>
Authored: Sun Oct 16 16:23:04 2016 -0400
Committer: Wes McKinney <wes.mckin...@twosigma.com>
Committed: Sun Oct 16 16:23:04 2016 -0400

----------------------------------------------------------------------
 ci/travis_script_cpp.sh  |  4 ++++
 dev/release/02-source.sh | 37 ++++--------------------------
 dev/release/run-rat.sh   | 53 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/8520061d/ci/travis_script_cpp.sh
----------------------------------------------------------------------
diff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.sh
index c3bd3b5..d555cab 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_DIR
 
 make lint

http://git-wip-us.apache.org/repos/asf/arrow/blob/8520061d/dev/release/02-source.sh
----------------------------------------------------------------------
diff --git a/dev/release/02-source.sh b/dev/release/02-source.sh
index 1bbe2e9..bdaa5cc 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" ]; then
   echo "Usage: $0 <version> <rc-num>"
   exit
@@ -56,36 +58,7 @@ tarball=$tag.tar.gz
 # archive (identical hashes) using the scm tag
 git 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 archive
 gpg --armor --output ${tarball}.asc --detach-sig $tarball

http://git-wip-us.apache.org/repos/asf/arrow/blob/8520061d/dev/release/run-rat.sh
----------------------------------------------------------------------
diff --git a/dev/release/run-rat.sh b/dev/release/run-rat.sh
new file mode 100755
index 0000000..d8ec650
--- /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
+
+

Reply via email to