You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2021/08/30 05:41:54 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #997] Fix build error when project path contains `kyuubi-`

This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 7141f2f  [KYUUBI #997] Fix build error when project path contains `kyuubi-`
7141f2f is described below

commit 7141f2f13e27d7344cf8340c4c7c52d748d56d1d
Author: fwang12 <fw...@ebay.com>
AuthorDate: Mon Aug 30 13:41:46 2021 +0800

    [KYUUBI #997] Fix build error when project path contains `kyuubi-`
    
    <!--
    Thanks for sending a pull request!
    
    Here are some tips for you:
      1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
      2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
      3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
    -->
    
    ### _Why are the changes needed?_
    The building will fail if the project name contains `kyuubi-`.
    For example: for our jenkins job, its name is `kyuubi-binary-build`, and the TMP dir won't be created because all the jar files are filtered because their absolute path contains `kyuubi-`.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #997 from turboFei/fix_collect_license.
    
    Closes #997
    
    eef47b79 [fwang12] follow up
    45fe7834 [fwang12] replace tab with 2 spaces
    f6589403 [fwang12] refactor
    c0cddd96 [fwang12] fix build error
    
    Authored-by: fwang12 <fw...@ebay.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 build/release/collect-licenses.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/build/release/collect-licenses.sh b/build/release/collect-licenses.sh
index 83f2d4a..a4e8630 100755
--- a/build/release/collect-licenses.sh
+++ b/build/release/collect-licenses.sh
@@ -39,16 +39,18 @@ USAGE="$0 <SOURCE_DIRECTORY:-.> <OUTPUT_DIRECTORY:-licenses-output>"
 source "$KYUUBI_DIR/build/util.sh"
 
 if [ "${SRC}" = "-h" ]; then
-	echo "${USAGE}"
-	exit 0
+  echo "${USAGE}"
+  exit 0
 fi
 
-for jar_file in $(find -L "${SRC}" -name "*.jar" | grep -v "kyuubi-")
+for jar_file in $(find -L "${SRC}" -name "*.jar")
 do
-	DIR="${TMP}/$(basename -- "${jar_file}" .jar)"
-	mkdir -p "${DIR}"
-	JAR=$(realpath "${jar_file}")
-	(cd "${DIR}" && jar xf ${JAR} META-INF/NOTICE META-INF/licenses)
+  if [[ "$(basename ${jar_file})" != "kyuubi-"* ]]; then
+    DIR="${TMP}/$(basename -- "${jar_file}" .jar)"
+    mkdir -p "${DIR}"
+    JAR=$(realpath "${jar_file}")
+    (cd "${DIR}" && jar xf ${JAR} META-INF/NOTICE META-INF/licenses)
+  fi
 done
 
 NOTICE="${DST}/NOTICE"