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

Add -f to %_default_patch_flags #1513

Merged
merged 1 commit into from Jan 26, 2021
Merged

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Jan 22, 2021

This prevents the patch utility to ask questions during builds.
See man patch for details

Resolves: #978

@pmatilai
Copy link
Member

pmatilai commented Jan 25, 2021

Looking back at patch(1) manual reminds me of why this was left lingering: both --batch and --force take some funny assumptions that are not individually settable, and also not quite what you'd want for rpm use: we wouldn't want rpm to skip anything, we'd like it to error out on those questionable things, but no such option exists.

Re-reading up on all that a couple of times, and checking out what exactly is this Prereq it talks about, I agree --force is the option we want, but please document the rationale of choosing this particular flag (over others) in the commit message for future generations.

@pmatilai
Copy link
Member

Oh and while the commit message gets updated: the patch itself documents what options gets added where, repeating that it the summary is not adding any information. The summary should state what is achieved by that (ie ensure non-interactive patch application), the details and rationale behind this particular flag explained in the message.

It may seem obvious and redundant now but a few years down the road, when the next person comes along to suggest something else...

Builds should always run unattended and never require user interactions.
We also don't want unser input to affect the result. Without any options
patch will ask for files to patch or whether it should reverse pachtes if
they could be applied then.

As -t aka --batch does reverse patches and skips patches with wrong version
for the Prereq: line it is not suited for rpmbuild. We rather want the
build to fail than silently drop (possibly security relevant) patches.

We would prefer patch to error out when ever the patch looks not quite matching
but -f aka --force is the option available closest to that.

See man patch for details

Resolves: rpm-software-management#978
@ffesti
Copy link
Contributor Author

ffesti commented Jan 26, 2021

OK, changed summary and extended the commit message.

@pmatilai
Copy link
Member

Thanks, I like it a lot better this way :)

@pmatilai pmatilai merged commit 11f7c13 into rpm-software-management:master Jan 26, 2021
@ffesti ffesti deleted the 978 branch May 13, 2022 09:39
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

Successfully merging this pull request may close these issues.

RFE: Noninteractive rpmbuild
2 participants