[Rpm-maint] [rpm-software-management/rpm] RFE: Noninteractive rpmbuild (#978)

Miroslav Suchý notifications at github.com
Mon Dec 16 16:17:48 UTC 2019


Right now, the rpmbuild is noninteractive. With only one exception: when you have PatchX which does not apply cleanly, you will get prompt from patch(1).

Here is such example http://miroslav.suchy.cz/tmp/python-aiosmtpd-1.2.1-3.fc32.src.rpm
This is coming from bug originally submitted against Copr https://bugzilla.redhat.com/show_bug.cgi?id=1783868

This src.rpm contains patch which applies cleanly with bigger fuzziness, but with fuzziness set to zero, it does not apply cleanly.

Rpmbuild executes patch(1) and the outpus is as follows:

```
+ /usr/bin/patch -s --fuzz=0 --no-backup-if-mismatch
The text leading up to this was:
--------------------------
|From f414dcdc0312c4cf3f3d39deb3ea7d15e89a5334 Mon Sep 17 00:00:00 2001
|From: Wayne Werner <wayne at waynewerner.com>
|Date: Sat, 1 Jun 2019 14:00:30 +0000
|Subject: [PATCH] Create new ssl certs
|
|These ones will be valid for 100 years, so that should be plenty of
|time for running tests before they have to be recreated.
|---
| aiosmtpd/tests/certs/server.crt | 43 +++++++++++++--------------
| aiosmtpd/tests/certs/server.key | 52 ++++++++++++++++-----------------
| 2 files changed, 47 insertions(+), 48 deletions(-)
|
|diff --git a/aiosmtpd/tests/certs/server.crt b/aiosmtpd/tests/certs/server.crt
|index e4f8f09..04f19cf 100644
|--- a/aiosmtpd/tests/certs/server.crt
|+++ b/aiosmtpd/tests/certs/server.crt
--------------------------
File to patch:
```
And here it hangs and waits for user input. Mock will eventually kill the process when `config_opts['rpmbuild_timeout']` is set. Copr does that, but the timeout is set to hours, because it is shared with `rpmbuild -bb` as well.

This situation is in build systems (Koji, Copr) unresolvable and is equal to build failure. It would be nice if we can fail the build faster.

While I can work around it by using expect(1), it brings new dependency and it will be fragile.

It will be nice if rpmbuild can execute patch with `--force`. Man page of patch is a bit fuzzy, but as you can see in https://stackoverflow.com/questions/37157658/patch-run-in-non-interactive-mode
it will fail with exit code 1, which rpmbuild can detect and exit as well.

This does not need to be the default. You can expose this behavior only with some command-line option. I can then utilize it in Mock.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/978
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191216/b02aa227/attachment.html>


More information about the Rpm-maint mailing list