From c72dd0bb14da25cfe992a5ced3830e26a2b8cb0f Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 6 Sep 2024 18:17:19 -0700 Subject: [PATCH] maketgz: fix RELEASE-TOOLS.md for daily tarballs The daily snapshots have no associated git tag, so provide a commit hash instead in these cases. Fix the dpkg detection since the shell would exit immediately without showing an error message if it weren't found. Closes #14820 --- scripts/maketgz | 6 +++--- scripts/release-tools.sh | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/maketgz b/scripts/maketgz index 996fd06fed..af62708bc1 100755 --- a/scripts/maketgz +++ b/scripts/maketgz @@ -156,14 +156,14 @@ else automake --include-deps Makefile >/dev/null fi -echo "produce RELEASE-TOOLS.md" -./scripts/release-tools.sh "$timestamp" "$version" > docs/RELEASE-TOOLS.md.dist - if test -n "$commit"; then echo "produce docs/tarball-commit.txt" git rev-parse HEAD >docs/tarball-commit.txt.dist fi +echo "produce RELEASE-TOOLS.md" +./scripts/release-tools.sh "$timestamp" "$version" "$commit" > docs/RELEASE-TOOLS.md.dist + ############################################################################ # # Now run make dist to generate a tar.gz archive diff --git a/scripts/release-tools.sh b/scripts/release-tools.sh index faf5d32603..4c4ed7d809 100755 --- a/scripts/release-tools.sh +++ b/scripts/release-tools.sh @@ -29,6 +29,11 @@ set -eu timestamp=${1:-unknown} version=${2:-unknown} tag=$(echo "curl-$version" | tr '.' '_') +commit=${3} +if [ -n "$commit" ] && [ -r "docs/tarball-commit.txt.dist" ]; then + # If commit is given, then the tag likely doesn't actually exist + tag="$(cat docs/tarball-commit.txt.dist)" +fi cat </dev/null) -if test ! -e "$exists"; then - echo "(unknown, could not find dpkg)" - exit +if ! command -v dpkg >/dev/null; then + echo "Error: could not find dpkg" >&2 + exit 1 fi debian() { @@ -58,7 +62,7 @@ cat <