Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn deprecated %patchN syntax into %patch -PN #499

Open
xsuchy opened this issue May 6, 2024 · 3 comments
Open

Turn deprecated %patchN syntax into %patch -PN #499

xsuchy opened this issue May 6, 2024 · 3 comments

Comments

@xsuchy
Copy link
Member

xsuchy commented May 6, 2024

RPM has deprecated the %patchN syntax in favor of %patch -PN where N is
the patch number for a year now.
See https://lists.fedoraproject.org/archives/list/[email protected]/thread/IYU7AG53C6YWZWHUJJYQBVVU2O7EQ2F6/

And Tito will be affected:

$ git grep Patch
src/tito/builder/main.py:        patch_pattern = re.compile(r'^Patch(\d+):')
src/tito/builder/main.py:        # Find the largest PatchX: line, or failing that SourceX:
src/tito/builder/main.py:        patch_number = 0  # What number should we use for our PatchX line
src/tito/builder/main.py:        patch_insert_index = 0  # Where to insert our PatchX line in the list
src/tito/builder/main.py:            error_out("Unable to insert PatchX or %patchX lines in spec file")
src/tito/builder/main.py:        debug("Patch: %s" % patch_file)
src/tito/builder/main.py:        lines.insert(patch_insert_index, "Patch%s: %s\n" % (patch_number,
src/tito/distributionbuilder.py:      Patch0: foo-1.2.13-1-to-foo-1.2.13-3-sat.patch
src/tito/distributionbuilder.py:      Patch0: foo-1.2.13-1-to-foo-1.2.13-2-sat.patch
src/tito/distributionbuilder.py:      Patch1: foo-1.2.13-2-to-foo-1.2.13-3-sat.patch
src/tito/distributionbuilder.py:            lines.insert(patch_insert_index, "Patch%s: %s\n" % (patch_number, patch))
tito.props.5.asciidoc:put in spec file as Patch0.
tito.props.5.asciidoc: Patch0: foo-1.2-1-to-foo-1.2-2.patch
tito.props.5.asciidoc: Patch1: foo-1.2-1-to-foo-1.2-3.patch
@xsuchy xsuchy added this to CPT Kanban May 6, 2024
@xsuchy xsuchy moved this to Needs triage in CPT Kanban May 6, 2024
@praiskup
Copy link
Member

praiskup commented May 6, 2024

I thought %patch N is the preferred variant 8-)

@decathorpe
Copy link

AFAIK %patch N is the modern syntax, but that's not supported by all RPM versions that are still relevant.

@praiskup
Copy link
Member

praiskup commented May 9, 2024

Could we use %autosetup instead?

@praiskup praiskup moved this from Needs triage to In 3 months in CPT Kanban May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants