Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 42BB9200BA2 for ; Sun, 16 Oct 2016 22:23:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 412E5160AE7; Sun, 16 Oct 2016 20:23:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8982F160AD0 for ; Sun, 16 Oct 2016 22:23:11 +0200 (CEST) Received: (qmail 83355 invoked by uid 500); 16 Oct 2016 20:23:10 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 83346 invoked by uid 99); 16 Oct 2016 20:23:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Oct 2016 20:23:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A5AF9E05D9; Sun, 16 Oct 2016 20:23:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wesm@apache.org To: commits@arrow.apache.org Message-Id: <30caf2913af842379bffec64f19712eb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: arrow git commit: ARROW-336: Run Apache Rat in Travis builds Date: Sun, 16 Oct 2016 20:23:10 +0000 (UTC) archived-at: Sun, 16 Oct 2016 20:23:12 -0000 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 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 Authored: Sun Oct 16 16:23:04 2016 -0400 Committer: Wes McKinney 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 " 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 + +