packit: don't use fix-spec to change version in specfile#23110
Open
tomasmatus wants to merge 2 commits intocockpit-project:mainfrom
Open
packit: don't use fix-spec to change version in specfile#23110tomasmatus wants to merge 2 commits intocockpit-project:mainfrom
tomasmatus wants to merge 2 commits intocockpit-project:mainfrom
Conversation
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.
martinpitt
previously approved these changes
Apr 8, 2026
Member
martinpitt
left a comment
There was a problem hiding this comment.
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.
jelly
requested changes
Apr 14, 2026
| 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" |
Member
There was a problem hiding this comment.
Why do you drop the PACKIT_PROJECT_VERSION here?
jelly
reviewed
Apr 14, 2026
|
|
||
| if [ -n "$version" ]; then | ||
| sed -i '/Version/ s/0/'"$version"'/' "$spec".new | ||
| sed -i '/Version/ s/\b0\b/'"$version"'/' "$spec".new |
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.