@@ -15,9 +15,7 @@ OUTPUT=${OUTPUT-${SOURCES}}
1515# If a GitHub token is provided, configure netrc/curl for private source access
1616# Prefer GITHUB_TOKEN, then GITHUB_API_TOKEN, then LASTVERSION_GITHUB_API_TOKEN
1717GH_TOK=" ${GITHUB_TOKEN:- ${GITHUB_API_TOKEN:- ${LASTVERSION_GITHUB_API_TOKEN} } } "
18- echo " GitHub token detection: GITHUB_TOKEN=${GITHUB_TOKEN: +set} GITHUB_API_TOKEN=${GITHUB_API_TOKEN: +set} LASTVERSION_GITHUB_API_TOKEN=${LASTVERSION_GITHUB_API_TOKEN: +set} GH_TOK=${GH_TOK: +set} "
1918if [ -n " ${GH_TOK} " ]; then
20- echo " Configuring .netrc for GitHub private repo access..."
2119 # use restrictive umask only for writing secrets, then restore
2220 __OLD_UMASK=$( umask)
2321 umask 077
@@ -369,6 +367,8 @@ build_package() {
369367
370368 cd " ${BUILD_ROOT} "
371369
370+ # Track module version separately for combined versioning (like RPM's nginx_version+module_version)
371+ MODULE_VERSION=" "
372372 if [[ -f " version.yml" ]]; then
373373 echo " Found version.yml; fetching external module source..."
374374 # shellcheck disable=SC2015
@@ -383,6 +383,7 @@ build_package() {
383383 tar -xzf module.tgz
384384 rm -f module.tgz || true
385385 TAG_NOPREFIX=" ${TAG# v} "
386+ MODULE_VERSION=" ${TAG_NOPREFIX} "
386387 if [[ -d " ${NAME} -${TAG} " ]] && [[ " ${TAG} " != " ${TAG_NOPREFIX} " ]] && [[ ! -d " ${NAME} -${TAG_NOPREFIX} " ]]; then
387388 mv " ${NAME} -${TAG} " " ${NAME} -${TAG_NOPREFIX} "
388389 fi
@@ -471,19 +472,26 @@ build_package() {
471472 } > debian/changelog
472473 fi
473474
475+ # Compute package version: nginx_version+module_version (like RPM) when module exists
476+ PACKAGE_VERSION=" ${UPSTREAM_VERSION} "
477+ if [[ -n " ${MODULE_VERSION} " ]]; then
478+ PACKAGE_VERSION=" ${UPSTREAM_VERSION} +${MODULE_VERSION} "
479+ echo " Module version detected: using combined version ${PACKAGE_VERSION} "
480+ fi
481+
474482 STAMPED=false
475483 if grep -qE ' VERSION|REVISION|SUITE_CODENAME' debian/changelog; then
476- [[ -n " ${UPSTREAM_VERSION } " ]] && sed -i " s/VERSION/${UPSTREAM_VERSION } /g" debian/changelog
484+ [[ -n " ${PACKAGE_VERSION } " ]] && sed -i " s/VERSION/${PACKAGE_VERSION } /g" debian/changelog
477485 sed -i " s/REVISION/${REVISION} /g" debian/changelog
478486 sed -i " s/SUITE_CODENAME/${SUITE_CODENAME} /g" debian/changelog
479- echo " Stamped debian/changelog with VERSION=${UPSTREAM_VERSION } , REVISION=${REVISION} , SUITE_CODENAME=${SUITE_CODENAME} "
487+ echo " Stamped debian/changelog with VERSION=${PACKAGE_VERSION } , REVISION=${REVISION} , SUITE_CODENAME=${SUITE_CODENAME} "
480488 STAMPED=true
481489 fi
482490
483491 # If debian/control uses VERSION as a placeholder anywhere
484492 # (e.g. Provides: nginx-rVERSION, Depends: foo-VERSION, etc.),
485- # stamp it to the resolved upstream version so this logic is
486- # reusable beyond nginx-specific packages .
493+ # stamp it to the resolved upstream version (NOT combined version,
494+ # as dependencies like nginx-rVERSION need just the nginx version) .
487495 if [[ -n " ${UPSTREAM_VERSION} " ]] && [[ -f " debian/control" ]] && grep -q " VERSION" debian/control; then
488496 sed -i " s/VERSION/${UPSTREAM_VERSION} /g" debian/control
489497 echo " Stamped debian/control with VERSION=${UPSTREAM_VERSION} "
0 commit comments