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 <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar
2025-09-04 15:53:18 -04:00
committed by Miloslav Trmač
parent ee194d4c44
commit af27d1d877
2 changed files with 8 additions and 1 deletions

View File

@@ -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"

View File

@@ -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}