From af27d1d8777457114139435886e9c921559a2170 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 4 Sep 2025 15:53:18 -0400 Subject: [PATCH] Packit/RPM: Epoch and version fetching fixes 1. Packit config includes a `get-current-version` action to fetch the version from `version/version.go` and not from the default `git describe`. So, the copr rpm version will always be ahead of what's in the official repos. 2. The absurdly high RPM Epoch is now limited to builds from rhcontainerbot/podman-next copr. So, copr builds on PR jobs will use the default Epoch value. These two changes will make it easier for testers to fetch the scratch copr builds from upstream PRs and it should allow for seamless upgrades. (official rpm -> test copr rpm for bugfix -> upgrade to new official rpm) Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 2 ++ rpm/skopeo.spec | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.packit.yaml b/.packit.yaml index ed64d93e..ae7b2770 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -19,7 +19,9 @@ packages: skopeo-eln: specfile_path: rpm/skopeo.spec +# https://packit.dev/docs/configuration/actions actions: + get-current-version: bash -c 'grep "^const Version" version/version.go | cut -f2 -d\" | tr \- \~' prepare-files: >- bash -c "sed -i 's/^\(\s*\)ref: .*/\1ref: \"${PACKIT_PROJECT_TAG}\"/' ${PACKIT_DOWNSTREAM_REPO}/plans/main.fmf" diff --git a/rpm/skopeo.spec b/rpm/skopeo.spec index d7510fdd..9e0dfd07 100644 --- a/rpm/skopeo.spec +++ b/rpm/skopeo.spec @@ -26,8 +26,13 @@ %define conditional_epoch 2 %endif +# set higher Epoch only for podman-next builds +%if %{defined copr_username} && "%{copr_username}" == "rhcontainerbot" && "%{copr_projectname}" == "podman-next" +%define next_build 1 +%endif + Name: skopeo -%if %{defined copr_username} +%if %{defined next_build} Epoch: 102 %else Epoch: %{conditional_epoch}