@@ -115,7 +115,7 @@ def getPkgNameSuffix(component, type) {
115115def getParentDir (bigtopBaseVersion , type ) {
116116 def defaultParentDirValue = type. equalsIgnoreCase(" deb" ) ? " " : " %{nil}"
117117 def parentDir = project. hasProperty(" parentDir" ) ? project. property(' parentDir' ) : defaultParentDirValue
118- if (parentDir && parentDir != " %{nil} " ) {
118+ if (parentDir != defaultParentDirValue ) {
119119 parentDir = " ${ parentDir} /${ bigtopBaseVersion} "
120120 }
121121 return parentDir
@@ -382,7 +382,10 @@ def genTasks = { target ->
382382 def final BASE_VERSION = config. bigtop. components[target]. version. base
383383 def final SRCDEB = " ${ PKG_NAME} _$PKG_VERSION -${ BIGTOP_BUILD_STAMP} .dsc"
384384 def final HADOOP_VERSION = config. bigtop. components[" hadoop" ]. version. pkg
385-
385+ def final FULL_PARENT_DIR = getParentDir(config. bigtop. base_version, " deb" )
386+ def final DEB_PKG_NAME_SUFFIX = getPkgNameSuffix(config. bigtop. components[target], " deb" ). pkgNameSuffix
387+ def final BIGTOP_BASE_VERSION = " ${ config.bigtop.base_version} "
388+
386389 exec {
387390 workingDir PKG_OUTPUT_DIR
388391 commandLine " dpkg-source -x $SRCDEB " . split(' ' )
@@ -399,6 +402,9 @@ def genTasks = { target ->
399402--set-envvar=${ toOldStyleName(target)} _BASE_VERSION=$BASE_VERSION \
400403--set-envvar=${ toOldStyleName(target)} _VERSION=$PKG_VERSION \
401404--set-envvar=${ toOldStyleName(target)} _RELEASE=$BIGTOP_BUILD_STAMP \
405+ --set-envvar=PARENT_DIR=$FULL_PARENT_DIR \
406+ --set-envvar=PKG_NAME_SUFFIX=$DEB_PKG_NAME_SUFFIX \
407+ --set-envvar=bigtop_base_version=${ BIGTOP_BASE_VERSION} \
402408-uc -us -b
403409"""
404410 exec {
@@ -428,6 +434,8 @@ def genTasks = { target ->
428434 println " \t Nothing to do. Exiting..."
429435 return
430436 }
437+
438+ def final BIGTOP_BASE_VERSION = " ${ config.bigtop.base_version} "
431439 def final BIGTOP_BUILD_STAMP = System . getenv(' BIGTOP_BUILD_STAMP' ) ?:
432440 config. bigtop. components[target]. version. release
433441 def final TARBALL_SRC = config. bigtop. components[target]. tarball. source
@@ -443,6 +451,8 @@ def genTasks = { target ->
443451 def final DEB_PKG_DIR = " $PKG_BUILD_DIR /deb/$PKG_NAME -${ PKG_VERSION} -${ BIGTOP_BUILD_STAMP} "
444452 def final ENABLE_MAVEN_PARALLEL_BUILD = config. bigtop. components[target]. maven_parallel_build
445453 def final MAVEN_BUILD_THREADS = project. hasProperty(' buildThreads' ) ? project. property(' buildThreads' ) : null
454+ def final FULL_PARENT_DIR = getParentDir(config. bigtop. base_version, " deb" )
455+ def final DEB_PKG_NAME_SUFFIX = getPkgNameSuffix(config. bigtop. components[target], " deb" ). pkgNameSuffix
446456
447457 mkdir (DEB_BLD_DIR )
448458 copy {
@@ -511,6 +521,9 @@ def genTasks = { target ->
511521 // Creating source package
512522 exec {
513523 workingDir DEB_BLD_DIR
524+ environment ' PARENT_DIR' , FULL_PARENT_DIR
525+ environment ' PKG_NAME_SUFFIX' , DEB_PKG_NAME_SUFFIX
526+ environment ' bigtop_base_version' , BIGTOP_BASE_VERSION
514527 commandLine " dpkg-buildpackage -uc -us -sa -S" . split(' ' )
515528 }
516529 mkdir(PKG_OUTPUT_DIR )
0 commit comments