Skip to content

packit: don't use fix-spec to change version in specfile#23110

Open
tomasmatus wants to merge 2 commits intocockpit-project:mainfrom
tomasmatus:fix-spec-fixer
Open

packit: don't use fix-spec to change version in specfile#23110
tomasmatus wants to merge 2 commits intocockpit-project:mainfrom
tomasmatus:fix-spec-fixer

Conversation

@tomasmatus
Copy link
Copy Markdown
Member

As release of cockpit 360 showed the version in cockpit.spec is already set to the correct number. As a result the correct version was replaced as 360 -> 36360.

As release of cockpit 360 showed the version in cockpit.spec is already
set to the correct number. As a result the correct version was replaced
as 360 -> 36360.
@tomasmatus tomasmatus added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Apr 8, 2026
@tomasmatus tomasmatus requested a review from martinpitt April 8, 2026 16:23
martinpitt
martinpitt previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers! I would have liked a \b0\b fix on the actual sed call as well to fix the time bomb, so for extra bonus please fix that as well.

Copy link
Copy Markdown
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dekuji!

Copy link
Copy Markdown
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

env | grep PACKIT
tar -xJf "${PACKIT_DOWNSTREAM_REPO:-${PACKIT_UPSTREAM_REPO}}/cockpit-${PACKIT_PROJECT_VERSION}.tar.xz" "cockpit-*/runtime-npm-modules.txt" --strip-components=1
tools/fix-spec "${PACKIT_DOWNSTREAM_REPO:-${PACKIT_UPSTREAM_REPO}}/cockpit.spec" "${PACKIT_PROJECT_VERSION}"
tools/fix-spec "${PACKIT_DOWNSTREAM_REPO:-${PACKIT_UPSTREAM_REPO}}/cockpit.spec"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you drop the PACKIT_PROJECT_VERSION here?


if [ -n "$version" ]; then
sed -i '/Version/ s/0/'"$version"'/' "$spec".new
sed -i '/Version/ s/\b0\b/'"$version"'/' "$spec".new
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the -n "$version is "-n STRING: the length of the STRING is nonzero", which means if we call tools/fix-spec now without a version it won't even run this sed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-test For doc/workflow changes, or experiments which don't need a full CI run,

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants