public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Viktor Malik <vmalik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/bpftrace] rawhide: Add test-release.sh script
Date: Thu, 03 Sep 2026 10:43:10 GMT	[thread overview]
Message-ID: <178843219099.1.14600454137360323786.rpms-bpftrace-ff33069cce9e@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/bpftrace
            Branch : rawhide
            Commit : ff33069cce9e09e6a3fce5bb495cf9d6dc3a3b3e
            Author : Viktor Malik <vmalik@redhat.com>
            Date   : 2026-09-03T12:36:48+02:00
            Stats  : +32/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/bpftrace/c/ff33069cce9e09e6a3fce5bb495cf9d6dc3a3b3e?branch=rawhide

            Log:
            Add test-release.sh script

The script allows to run a scratch build of an upcoming future release
from the GitHub release branch. It accepts the release number as a
parameter and does:
- download the tarball from the corresponding release branch,
- unpacks the tarball, renames the contained directory with the expected
  released name, and repacks it back to the tarball,
- runs a scratch build.

This is useful to check if the upcoming release builds in Fedora and
successfully runs unit tests.

Signed-off-by: Viktor Malik <vmalik@redhat.com>

---
diff --git a/test-release.sh b/test-release.sh
new file mode 100755
index 0000000..169097a
--- /dev/null
+++ b/test-release.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -euo pipefail
+
+if [ $# -ne 1 ]; then
+    echo "Usage: $0 <version>" >&2
+    echo "Example: $0 0.27.0" >&2
+    exit 1
+fi
+
+VERSION="$1"
+BRANCH_VERSION="${VERSION%.*}.x"
+TARBALL="bpftrace-${VERSION}.tar.gz"
+BRANCH_DIR="bpftrace-release-${BRANCH_VERSION}"
+TARGET_DIR="bpftrace-${VERSION}"
+
+echo "Downloading tarball from release/${BRANCH_VERSION} branch..."
+curl -Lo "${TARBALL}" \
+    "https://github.com/bpftrace/bpftrace/archive/refs/heads/release/${BRANCH_VERSION}.tar.gz"
+
+echo "Repacking tarball as ${TARBALL}..."
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT
+tar xzf "${TARBALL}" -C "$tmpdir"
+mv "$tmpdir/${BRANCH_DIR}" "$tmpdir/${TARGET_DIR}"
+tar czf "${TARBALL}" -C "$tmpdir" "${TARGET_DIR}"
+
+echo "Updating spec file version to ${VERSION}..."
+sed -i "s/^Version:.*/Version:        ${VERSION}/" bpftrace.spec
+sed -i "s/^Release:.*/Release:        1%{?dist}/" bpftrace.spec
+
+echo "Running scratch build..."
+fedpkg scratch-build --srpm

                 reply	other threads:[~2026-09-03 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178843219099.1.14600454137360323786.rpms-bpftrace-ff33069cce9e@fedoraproject.org \
    --to=vmalik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox