This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from 2bdbec0 bin/debian-codename-to-version.sh: bullseye is stable, mark as such. new 9952620 bin/: add gitdate utility, fetching the commit date of HEAD in UTC and our custom yearmonthdate format. new c71406a /: add .gitignore. new fa95372 bin/{build-{deb,osx,rpm}-package,build-nsis-package.sh,generate-nsis-version.pl,pkgneedsbuild,sbuild-deb-package}: switch to UTC time for dates. new 94032bb bin/{build-{deb,osx,rpm}-package,build-nsis-package.sh,sbuild-deb-package}: switch to git date instead of script starting date and add build number to version, coming in from the environment (most likely Jenkins). The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: .gitignore | 2 ++ bin/build-deb-package | 13 +++++++++---- bin/build-nsis-package.sh | 9 +++++++-- bin/build-osx-package | 16 ++++++++++------ bin/build-rpm-package | 13 +++++++++---- bin/generate-nsis-version.pl | 2 +- bin/{gitrevno => gitdate} | 22 +++++++++++----------- bin/pkgneedsbuild | 2 +- bin/sbuild-deb-package | 13 +++++++++---- 9 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 .gitignore copy bin/{gitrevno => gitdate} (51%) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 995262098a036dc5bb57d8e92deb5ca89c75f00d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 14 22:26:29 2022 +0100 bin/: add gitdate utility, fetching the commit date of HEAD in UTC and our custom yearmonthdate format. --- bin/gitdate | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bin/gitdate b/bin/gitdate new file mode 100755 index 0000000..94226d1 --- /dev/null +++ b/bin/gitdate @@ -0,0 +1,26 @@ +#!/bin/bash + +# Copyright (C) 2022 by Mihai Moldovan <ionic@ionic.de> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Get the UNIX timestamp for the commit date. +# Note that UNIX timestamps are not really leap seconds safe (which means that +# POSIX-conforming systems will see a discontinuity on dates with leap +# seconds), but we probably don't care if the result is convertible to UTC in +# a reproducible manner. +# Additionally, we only request the first line as a safety measure, although +# there should only be one to begin with. +typeset ts="$(git show --no-color -s --pretty='%ct' 'HEAD' | head -n '1')" +date --date='TZ="UTC" @'"${ts}" -u '+%Y%m%d' -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit c71406a8e2d0de3c03ac54f7e3760c5220663fb2 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 14 22:37:44 2022 +0100 /: add .gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0f094e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# VIM temporary files. +.*.sw* -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit fa953723b08cd8cb031e0e8e3c62d7db0a94a865 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 14 22:39:58 2022 +0100 bin/{build-{deb,osx,rpm}-package,build-nsis-package.sh,generate-nsis-version.pl,pkgneedsbuild,sbuild-deb-package}: switch to UTC time for dates. This should make our builds timezone-independent. --- bin/build-deb-package | 4 ++-- bin/build-nsis-package.sh | 4 ++-- bin/build-osx-package | 4 ++-- bin/build-rpm-package | 4 ++-- bin/generate-nsis-version.pl | 2 +- bin/pkgneedsbuild | 2 +- bin/sbuild-deb-package | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/build-deb-package b/bin/build-deb-package index f32b513..665b82e 100755 --- a/bin/build-deb-package +++ b/bin/build-deb-package @@ -92,7 +92,7 @@ set_vars() { COMPONENT="${ARGV2_COMPONENT:-${COMPONENT:-$COMPONENT_NIGHTLY}}" CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" [ -n "${ARGV2_CODENAME}" ] && FORCE_BUILD="yes" || true - DATE="${DATE:-$(date +%Y%m%d)}" + DATE="${DATE:-$(date -u '+%Y%m%d')}" if [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}" ] || [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}-test" ] || grep -qs "$COMPONENT" <<< "${COMPONENT_RELEASES}"; then CHECKOUT="${3:-build-${COMPONENT}}" elif [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then @@ -102,7 +102,7 @@ set_vars() { exit 1 fi # the DATE might be given as ,,today'' from the command line - [ "x${DATE}" = "xtoday" ] && DATE="$(date +%Y%m%d)" + [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" diff --git a/bin/build-nsis-package.sh b/bin/build-nsis-package.sh index f86caa7..95a3310 100755 --- a/bin/build-nsis-package.sh +++ b/bin/build-nsis-package.sh @@ -78,7 +78,7 @@ set_vars() { COMPONENT="${ARGV2_COMPONENT:-${COMPONENT:-$COMPONENT_NIGHTLY}}" CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" [ -n "${ARGV2_CODENAME}" ] && FORCE_BUILD="yes" || true - DATE="${DATE:-$(date +%Y%m%d)}" + DATE="${DATE:-$(date -u '+%Y%m%d')}" if [ "x${COMPONENT}" = "x${COMPONENT_MAIN}" ]; then CHECKOUT="${3:-build-main}" elif [ "x${COMPONENT}" = "x${COMPONENT_MAIN_MSWIN}" ]; then @@ -93,7 +93,7 @@ set_vars() { exit 1 fi # the DATE might be given as ,,today'' from the command line - [ "x${DATE}" = "xtoday" ] && DATE="$(date +%Y%m%d)" + [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" # setting paths : ${PROJECT_DIR:="/cygdrive/d/Build/GIT/nightly/${l_DIST}/${l_CODENAME}/x2goclient"} diff --git a/bin/build-osx-package b/bin/build-osx-package index 80e4264..e309517 100755 --- a/bin/build-osx-package +++ b/bin/build-osx-package @@ -94,7 +94,7 @@ set_vars() { COMPONENT="${ARGV2_COMPONENT:-${COMPONENT:-$COMPONENT_NIGHTLY}}" CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" [ -n "${ARGV2_CODENAME}" ] && FORCE_BUILD="yes" || true - DATE="${DATE:-$(date +%Y%m%d)}" + DATE="${DATE:-$(date -u '+%Y%m%d')}" if [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}" ] || [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}-test" ] || grep -qs "$COMPONENT" <<< "${COMPONENT_RELEASES}"; then CHECKOUT="${3:-build-${COMPONENT}}" elif [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then @@ -104,7 +104,7 @@ set_vars() { exit 1 fi # the DATE might be given as ,,today'' from the command line - [ "x${DATE}" = "xtoday" ] && DATE="$(date +%Y%m%d)" + [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 9fe88ca..31b1f83 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -147,7 +147,7 @@ set_vars() { COMPONENT="${ARGV2_COMPONENT:-${COMPONENT:-$COMPONENT_NIGHTLY}}" CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" [ -n "${ARGV2_CODENAME}" ] && FORCE_BUILD="yes" || true - DATE="${DATE:-$(date +%Y%m%d)}" + DATE="${DATE:-$(date -u '+%Y%m%d')}" if [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}" ] || [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}-test" ] || grep -qs "$COMPONENT" <<< "${COMPONENT_RELEASES}"; then CHECKOUT="${3:-build-${COMPONENT}}" elif [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then @@ -157,7 +157,7 @@ set_vars() { exit 1 fi # the DATE might be given as ,,today'' from the command line - [ "x${DATE}" = "xtoday" ] && DATE="$(date +%Y%m%d)" + [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" diff --git a/bin/generate-nsis-version.pl b/bin/generate-nsis-version.pl index a562ebe..bc678a3 100755 --- a/bin/generate-nsis-version.pl +++ b/bin/generate-nsis-version.pl @@ -4,7 +4,7 @@ use strict; use POSIX qw(strftime); -my $date = strftime "%Y.%m.%d", localtime; +my $date = strftime "%Y.%m.%d", gmtime; open(F,"<$ARGV[0]/src/version.h") or die; my @lines=<F>; diff --git a/bin/pkgneedsbuild b/bin/pkgneedsbuild index d80cf03..0f4bdba 100755 --- a/bin/pkgneedsbuild +++ b/bin/pkgneedsbuild @@ -21,7 +21,7 @@ CHECKOUT=${1:-master} [ -d .git ] && { - TIMESTAMP=$(date +%s) + TIMESTAMP=$(date -u '+%s') CURRENT_BRANCH=$(git branch | grep "*" | awk '{print $2}') # switch to branch given as $CHECKOUT, if it does not exist locally, create it... diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package index 5ea9968..31ed634 100755 --- a/bin/sbuild-deb-package +++ b/bin/sbuild-deb-package @@ -95,7 +95,7 @@ set_vars() { COMPONENT="${ARGV2_COMPONENT:-${COMPONENT:-$COMPONENT_NIGHTLY}}" CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" [ -n "${ARGV2_CODENAME}" ] && FORCE_BUILD="yes" || true - DATE="${DATE:-$(date +%Y%m%d)}" + DATE="${DATE:-$(date -u '+%Y%m%d')}" if [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}" ] || [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}-test" ] || grep -qs "$COMPONENT" <<< "${COMPONENT_RELEASES}"; then CHECKOUT="${3:-build-${COMPONENT}}" elif [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then @@ -105,7 +105,7 @@ set_vars() { exit 1 fi # the DATE might be given as ,,today'' from the command line - [ "x${DATE}" = "xtoday" ] && DATE="$(date +%Y%m%d)" + [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 94032bb6526ea77aa19388e7860c16d06ce29c3d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 14 23:00:58 2022 +0100 bin/{build-{deb,osx,rpm}-package,build-nsis-package.sh,sbuild-deb-package}: switch to git date instead of script starting date and add build number to version, coming in from the environment (most likely Jenkins). This should fix the "cross-day" build issues we've been seeing for quite some time, in which builders started a calendrical day later published packages with a higher version number than others, which lead to dependency failures due to diverging arch-indep and arch sub-packages. --- bin/build-deb-package | 9 +++++++-- bin/build-nsis-package.sh | 5 +++++ bin/build-osx-package | 12 ++++++++---- bin/build-rpm-package | 9 +++++++-- bin/sbuild-deb-package | 9 +++++++-- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/bin/build-deb-package b/bin/build-deb-package index 665b82e..7bc9be6 100755 --- a/bin/build-deb-package +++ b/bin/build-deb-package @@ -104,6 +104,10 @@ set_vars() { # the DATE might be given as ,,today'' from the command line [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" + # This should typically be part of Jenkins's environment, but if we're + # building packages manually, provide a sane default.' + BUILD_NUMBER="${BUILD_NUMBER:-'0'}" + # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" PKGDIST="${HOME}/pkg-dist/${COMPONENT}/${PROJECT}" @@ -253,6 +257,7 @@ build_packages() { git checkout "${CHECKOUT}" || git checkout master find "${PROJECT_DIR}/../" -maxdepth 0 -mindepth 0 -type f | grep -qs "${PROJECT}_"*.orig.tar.gz && cp -- "${PROJECT_DIR}/../${PROJECT}_"*.orig.tar.gz .. GITREV="$(gitrevno)" + typeset gitdate="$(gitdate)" # we always build native packages for our repos SA_OPTION="" @@ -307,9 +312,9 @@ build_packages() { # modify changelog for this build if [ "${COMPONENT}" != "${COMPONENT_NIGHTLY}" ]; then - dch --distribution "${codename}" --force-distribution -l "+git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." + dch --distribution "${codename}" --force-distribution -l "+git${gitdate}.${GITREV}.${BUILD_NUMBER}+${numerical_version}.${COMPONENT}." "Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." else - dch --distribution "${codename}" --force-distribution -l "~git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Development-Snapshot!!! Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." + dch --distribution "${codename}" --force-distribution -l "~git${gitdate}.${GITREV}.${BUILD_NUMBER}+${numerical_version}.${COMPONENT}." "Development-Snapshot!!! Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." fi mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/"{amd64,i386} OTHERMIRROR="" diff --git a/bin/build-nsis-package.sh b/bin/build-nsis-package.sh index 95a3310..4193d9b 100755 --- a/bin/build-nsis-package.sh +++ b/bin/build-nsis-package.sh @@ -95,6 +95,10 @@ set_vars() { # the DATE might be given as ,,today'' from the command line [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" + # This should typically be part of Jenkins's environment, but if we're + # building packages manually, provide a sane default.' + BUILD_NUMBER="${BUILD_NUMBER:-'0'}" + # setting paths : ${PROJECT_DIR:="/cygdrive/d/Build/GIT/nightly/${l_DIST}/${l_CODENAME}/x2goclient"} PKGDIST="/cygdrive/d/Build/pkg-dist/nightly/${l_DIST}/${l_CODENAME}/x2goclient" @@ -212,6 +216,7 @@ build_packages() { git checkout "${CHECKOUT}" || git checkout master find "${PROJECT_DIR}/../" -type f -maxdepth 0 -mindepth 0 | grep -qs "${PROJECT}_"*.orig.tar.gz && cp "${PROJECT_DIR}/../${PROJECT}_"*.orig.tar.gz .. GITREV="$(gitrevno)" + typeset gitdate="$(gitdate)" # TODO: Improve generate-nsis-version.pl so that it can be run from another dir cd "/cygdrive/d/Build/buildscripts/bin/" diff --git a/bin/build-osx-package b/bin/build-osx-package index e309517..75ee650 100755 --- a/bin/build-osx-package +++ b/bin/build-osx-package @@ -106,6 +106,10 @@ set_vars() { # the DATE might be given as ,,today'' from the command line [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" + # This should typically be part of Jenkins's environment, but if we're + # building packages manually, provide a sane default.' + BUILD_NUMBER="${BUILD_NUMBER:-'0'}" + # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" PKGDIST="${HOME}/pkg-dist/${COMPONENT}/${PROJECT}" @@ -269,9 +273,9 @@ build_packages() { typeset top_commit_id="$(git rev-parse --no-flags "HEAD^{commit}")" typeset base_name="${PROJECT}-${upstream_version}." if [ "${is_release}" -eq "0" ]; then - base_name="${base_name}git${DATE}.${gitrev}.${COMPONENT}." + base_name="${base_name}git${gitdate}.${gitrev}.${BUILD_NUMBER}.${COMPONENT}." else - base_name="${base_name}${DATE}." + base_name="${base_name}${gitdate}.${BUILD_NUMBER}." fi base_name="${base_name}OSX_${os_major}_${os_minor}.dmg" mv "client_build/${PROJECT}.dmg" "${PKGDIST}/${l_CODENAME}/${base_name}" @@ -314,10 +318,10 @@ upload_packages() { # Delete files so that checksums are always regenerated. if [ "${is_release}" -eq "0" ]; then # Nightly builds are tracked by date and gitrev, so that multiple packages are possible per day if the repository changes between builds. - 0</dev/null ssh -- "${REPOS_SERVER}" "rm -rf -- '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}/'*${DATE}.${gitrev}*OSX_${os_major}_${os_minor}*" + 0</dev/null ssh -- "${REPOS_SERVER}" "rm -rf -- '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}/'*${gitdate}.${gitrev}.${BUILD_NUMBER}*OSX_${os_major}_${os_minor}*" else # Releases are tracked by date, so that only one specific build per day is available. - 0</dev/null ssh -- "${REPOS_SERVER}" "rm -rf -- '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}/'*${DATE}*OSX_${os_major}_${os_minor}*" + 0</dev/null ssh -- "${REPOS_SERVER}" "rm -rf -- '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}/'*${gitdate}.${BUILD_NUMBER}*OSX_${os_major}_${os_minor}*" fi # Remove packages that are older than 30 days, if building nightlies. diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 31b1f83..b612357 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -159,6 +159,10 @@ set_vars() { # the DATE might be given as ,,today'' from the command line [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" + # This should typically be part of Jenkins's environment, but if we're + # building packages manually, provide a sane default.' + BUILD_NUMBER="${BUILD_NUMBER:-'0'}" + # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" PKGDIST="${HOME}/pkg-dist/${COMPONENT}/${PROJECT}" @@ -905,6 +909,7 @@ build_packages() { git clone --no-hardlinks --no-local "${PROJECT_DIR}" "${TEMP_DIR}/${PROJECT}/" cd "${TEMP_DIR}" GITREV="$(cd "${PROJECT}" && gitrevno && cd - 1>/dev/null)" + typeset gitdate="$(gitdate)" # create git changelog immediately prior to building the SRPM package pushd "${PROJECT}" >/dev/null 2>&1 && \ @@ -925,7 +930,7 @@ build_packages() { else IS_RELEASE="1" fi - sed -i "${PROJECT}.spec" -e "s/%{?dist}/.${IS_RELEASE}.git${DATE}.${GITREV}.${COMPONENT}%{?dist}/" + sed -i "${PROJECT}.spec" -e "s/%{?dist}/.${IS_RELEASE}.git${gitdate}.${GITREV}.${BUILD_NUMBER}.${COMPONENT}%{?dist}/" # apply patches from debian/patches/* so that they end up in the tarball # ... esp. relevant for NX (redistributed) @@ -1208,7 +1213,7 @@ build_packages() { # For information on why this weird -print0 | read -r -d '' construction works, # refer to the first instance of this in this script. - find "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM/" -type 'f' -iname "${RPMSRCPKG}-${UPSTREAM_VERSION}-${PKG_SRCRELEASE}.${IS_RELEASE}.git${DATE}.${GITREV}.${COMPONENT}.*.src.rpm" -print0 | while read -r -d '' srpm; do + find "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM/" -type 'f' -iname "${RPMSRCPKG}-${UPSTREAM_VERSION}-${PKG_SRCRELEASE}.${IS_RELEASE}.git${gitdate}.${GITREV}.${BUILD_NUMBER}.${COMPONENT}.*.src.rpm" -print0 | while read -r -d '' srpm; do if /usr/bin/mock ${MOCK_CHROOT_CONFIG} --resultdir="${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" "${srpm}"; then # Clean up source RPM files. We build them separately. find "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" -type 'f' -iname '*.src.rpm' -exec rm -f -- '{}' \; diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package index 31ed634..5b2b59e 100755 --- a/bin/sbuild-deb-package +++ b/bin/sbuild-deb-package @@ -107,6 +107,10 @@ set_vars() { # the DATE might be given as ,,today'' from the command line [ "x${DATE}" = "xtoday" ] && DATE="$(date -u '+%Y%m%d')" + # This should typically be part of Jenkins's environment, but if we're + # building packages manually, provide a sane default.' + BUILD_NUMBER="${BUILD_NUMBER:-'0'}" + # setting paths PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" PKGDIST="${HOME}/pkg-dist/${COMPONENT}/${PROJECT}" @@ -335,6 +339,7 @@ build_packages() { git checkout "${CHECKOUT}" || git checkout 'master' find "${PROJECT_DIR}/../" -maxdepth 0 -mindepth 0 -type f | grep -qs "${PROJECT}_"*.orig.tar.gz && cp -- "${PROJECT_DIR}/../${PROJECT}_"*.orig.tar.gz .. GITREV="$(gitrevno)" + typeset gitdate="$(gitdate)" # we always build native packages for our repos SA_OPTION="" @@ -408,9 +413,9 @@ build_packages() { # modify changelog for this build if [ "${COMPONENT}" != "${COMPONENT_NIGHTLY}" ]; then - dch --distribution "${codename}" --force-distribution -l "+git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." + dch --distribution "${codename}" --force-distribution -l "+git${gitdate}.${GITREV}.${BUILD_NUMBER}+${numerical_version}.${COMPONENT}." "Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." else - dch --distribution "${codename}" --force-distribution -l "~git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Development-Snapshot!!! Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." + dch --distribution "${codename}" --force-distribution -l "~git${gitdate}.${GITREV}.${BUILD_NUMBER}+${numerical_version}.${COMPONENT}." "Development-Snapshot!!! Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." fi typeset -i skip_arch_all="0" -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git