From a5261b6f44f338e3f4bd46fb29bed2c30e223bd4 Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Mon, 31 Aug 2015 08:52:12 -0500 Subject: [PATCH] HBASE-14337 Improve test-patch to better deal with dependency licenses * if we know we're going to fail the build via velocity template failure, output the cause in the generated LICENSE file. * tweak test-patch workspace handling to allow for checkout of repo next to patch process --- dev-support/test-patch.sh | 7 ++++++- .../src/main/resources/META-INF/LICENSE.vm | 14 +++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 33f84c5afd2..d3704bbce38 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -35,6 +35,7 @@ NEWLINE=$'\n' PROJECT_NAME=HBase JENKINS=false +MOVE_PATCH_DIR=true PATCH_DIR=/tmp BASEDIR=$(pwd) BRANCH_NAME="master" @@ -90,6 +91,9 @@ parseArgs() { --jenkins) JENKINS=true ;; + --no-move-patch-dir) + MOVE_PATCH_DIR=false + ;; --patch-dir=*) PATCH_DIR=${i#*=} ;; @@ -1001,8 +1005,9 @@ $comment" ### Cleanup files cleanupAndExit () { local result=$1 - if [[ $JENKINS == "true" ]] ; then + if [[ ${JENKINS} == "true" && ${MOVE_PATCH_DIR} == "true" ]] ; then if [ -e "$PATCH_DIR" ] ; then + echo "Relocating patch dir into ${BASEDIR}" mv $PATCH_DIR $BASEDIR fi fi diff --git a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm index d00b17cf4e8..54f53fdf88d 100644 --- a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm +++ b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm @@ -1560,13 +1560,21 @@ You can redistribute it and/or modify it under either the terms of the GPL #set($hadoop = false) ## include LICENSE sections for anything not under ASL2.0 #foreach( ${dep} in ${projects} ) +## if there are no licenses we'll fail the build later, so +## make sure we output something now that can be used to triage. +#if(${dep.licenses.size()} == 0) +No license info included; must update supplemental-models for: + +g:${dep.groupId} AND a:${dep.artifactId} AND v:${dep.version} + +Until hbase-resource-bundle/src/main/resources/supplemental-models.xml +is updated, the build should fail. +#end #if(${debug-print-included-work-info.equalsIgnoreCase("true")}) ===== Check license for included work -#if(${dep.licenses.size()} == 0) -No license info included; must update supplemental-models -#else +#if(${dep.licenses.size()} > 0) License short name: '${dep.licenses[0].name}' #end