Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/travis_script_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 5 additions & 32 deletions dev/release/02-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
53 changes: 53 additions & 0 deletions dev/release/run-rat.sh
Original file line number Diff line number Diff line change
@@ -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