From 0d820ddc8d2dde1070c312093699cc34623c36c5 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 8 Jan 2021 11:04:00 -0800 Subject: [PATCH] Packaging+GitLab CI: Dist tarball updates. Ninja keeps track of its built files in .ninja_log, so if you copy a pre-built target into a fresh build directory, Ninja will ignore and overwrite it. This includes the tarball generated by the 'dist' target. In get-export-release.sh, check for a preexisting tarball and preserve it by default. This lets us pass the dist tarball from one GitLab CI stage to other stages without recreating it. It's also arguably the right thing to do in general, since we record and publish the tarball hashes for each release and different contents for the same filename can cause confusion. Move the dist tarball to the build directory in .gitlab-ci.yml, and add a note about using the tarball exclusively. --- .gitlab-ci.yml | 3 +++ packaging/source/git-export-release.sh.in | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57a051d8dc..fca8abb2b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,11 +62,14 @@ variables: .build-rpm: extends: .build before_script: + # It might make sense to set "GIT_STRATEGY: none" and build from + # the tarball. - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - mkdir build - cd build - perl ../tools/make-version.pl --set-release + - mv -v ../wireshark-*.tar.* . artifacts: paths: - build/packaging/rpm/RPMS diff --git a/packaging/source/git-export-release.sh.in b/packaging/source/git-export-release.sh.in index ce1b0ca897..310e30133e 100755 --- a/packaging/source/git-export-release.sh.in +++ b/packaging/source/git-export-release.sh.in @@ -19,7 +19,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -set -e +set -e -u -o pipefail DESTDIR=. @@ -35,10 +35,15 @@ shift $(( OPTIND - 1 )) # or 3.4.5-67-gabcd4321 # By default the version from make-version.pl + CMake is used. VERSION=@VERSION@ -if test -n "$1"; then +if test -n "${1-}"; then VERSION="$1" fi +if [ -f "${DESTDIR}/wireshark-$VERSION.tar.xz" ] ; then + echo "${DESTDIR}/wireshark-$VERSION.tar.xz exists." + exit 0 +fi + STASH_POP=false XZ_OPTS= @@ -49,7 +54,7 @@ if ! git diff-index --quiet HEAD ; then STASH_POP=true fi -echo "Creating wireshark-$VERSION.tar.xz" +echo "Creating ${DESTDIR}/wireshark-$VERSION.tar.xz" echo . | xz --threads=0 > /dev/null 2>&1 && XZ_OPTS=--threads=0