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

iwasakims pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 081417e1e BIGTOP-4153: Enhance Bigtop package.gradle: Add pkgSuffix 
and parentDir Build Arguments for Deb Package (#1287)
081417e1e is described below

commit 081417e1e33da2d6b23347127e289ff79f44f947
Author: jialiang <[email protected]>
AuthorDate: Mon Jul 22 09:13:29 2024 +0800

    BIGTOP-4153: Enhance Bigtop package.gradle: Add pkgSuffix and parentDir 
Build Arguments for Deb Package (#1287)
---
 packages.gradle | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/packages.gradle b/packages.gradle
index 2901ea345..af7a5ba18 100644
--- a/packages.gradle
+++ b/packages.gradle
@@ -115,7 +115,7 @@ def getPkgNameSuffix(component, type) {
 def getParentDir(bigtopBaseVersion, type) {
     def defaultParentDirValue = type.equalsIgnoreCase("deb") ? "" : "%{nil}"
     def parentDir = project.hasProperty("parentDir") ? 
project.property('parentDir') : defaultParentDirValue
-    if (parentDir && parentDir != "%{nil}") {
+    if (parentDir != defaultParentDirValue) {
         parentDir = "${parentDir}/${bigtopBaseVersion}"
     }
     return parentDir
@@ -382,7 +382,10 @@ def genTasks = { target ->
     def final BASE_VERSION = config.bigtop.components[target].version.base
     def final SRCDEB = "${PKG_NAME}_$PKG_VERSION-${BIGTOP_BUILD_STAMP}.dsc"
     def final HADOOP_VERSION = config.bigtop.components["hadoop"].version.pkg
-
+    def final FULL_PARENT_DIR = getParentDir(config.bigtop.base_version, "deb")
+    def final DEB_PKG_NAME_SUFFIX =  
getPkgNameSuffix(config.bigtop.components[target], "deb").pkgNameSuffix
+    def final BIGTOP_BASE_VERSION = "${config.bigtop.base_version}"
+    
     exec {
       workingDir PKG_OUTPUT_DIR
       commandLine "dpkg-source -x $SRCDEB".split(' ')
@@ -399,6 +402,9 @@ def genTasks = { target ->
 --set-envvar=${toOldStyleName(target)}_BASE_VERSION=$BASE_VERSION \
 --set-envvar=${toOldStyleName(target)}_VERSION=$PKG_VERSION \
 --set-envvar=${toOldStyleName(target)}_RELEASE=$BIGTOP_BUILD_STAMP \
+--set-envvar=PARENT_DIR=$FULL_PARENT_DIR \
+--set-envvar=PKG_NAME_SUFFIX=$DEB_PKG_NAME_SUFFIX \
+--set-envvar=bigtop_base_version=${BIGTOP_BASE_VERSION} \
 -uc -us -b
 """
     exec {
@@ -428,6 +434,8 @@ def genTasks = { target ->
       println "\tNothing to do. Exiting..."
       return
     }
+
+    def final BIGTOP_BASE_VERSION = "${config.bigtop.base_version}"
      def final BIGTOP_BUILD_STAMP = System.getenv('BIGTOP_BUILD_STAMP') ?:
              config.bigtop.components[target].version.release
     def final TARBALL_SRC = config.bigtop.components[target].tarball.source
@@ -443,6 +451,8 @@ def genTasks = { target ->
     def final DEB_PKG_DIR = 
"$PKG_BUILD_DIR/deb/$PKG_NAME-${PKG_VERSION}-${BIGTOP_BUILD_STAMP}"
     def final ENABLE_MAVEN_PARALLEL_BUILD = 
config.bigtop.components[target].maven_parallel_build
     def final MAVEN_BUILD_THREADS = project.hasProperty('buildThreads') ? 
project.property('buildThreads') : null
+    def final FULL_PARENT_DIR = getParentDir(config.bigtop.base_version, "deb")
+    def final DEB_PKG_NAME_SUFFIX =  
getPkgNameSuffix(config.bigtop.components[target], "deb").pkgNameSuffix
 
     mkdir (DEB_BLD_DIR)
     copy {
@@ -511,6 +521,9 @@ def genTasks = { target ->
     // Creating source package
     exec {
       workingDir DEB_BLD_DIR
+      environment 'PARENT_DIR', FULL_PARENT_DIR
+      environment 'PKG_NAME_SUFFIX', DEB_PKG_NAME_SUFFIX
+      environment 'bigtop_base_version', BIGTOP_BASE_VERSION
       commandLine "dpkg-buildpackage -uc -us -sa -S".split(' ')
     }
     mkdir(PKG_OUTPUT_DIR)

Reply via email to