On 5/13/24 17:08, Vít Ondruch wrote:
Dne 13. 05. 24 v 15:22 Panu Matilainen napsal(a):
On 5/13/24 16:09, Vít Ondruch wrote:
Dne 13. 05. 24 v 11:39 Florian Festi napsal(a):
%patch otoh (now) is a regular (though internally implemented) macro
that is expanded with other macros and though can be used in other
macros and expressions.
Do I read correctly that we can now use `%patch` in e.g. `%check`
section? Interesting. Is this documented?
No, while %patch and %setup *could* be made available elsewhere now,
they are still only available in %prep because that's the only place
where they make sense.
Working with Ruby, which is interpreted language, there are cases where
we want to patch tests, while we want to keep them in their original
form in the package. This might sound weird, but the thing is that for
running tests, we might be limited by infrastructure. E.g. Koji does not
have internet access, builders are slow, etc. So we might want to apply
some patch to workaround such issues.
The rpm model is simply that all source preparation is done in %prep,
and everything is build around that design. There's no way to enforce
that, but things like having %setup and %patch only available there are
pretty strong hints at how it wants to be used.
I would make a copy of the tests for running purposes and patch that,
all in %prep. That way you can also use %autosetup for it all. There
will always be special circumstances, but on principle %patch should be
considered a legacy construct. Packagers shouldn't have to be bothering
with individual patch applications like that.
- Panu -
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue