On 14. 04. 23 12:10, Florian Weimer wrote:
* Miro Hrončok:
On 14. 04. 23 9:31, Florian Weimer wrote:
What's the -p default for %autosetup? Without any -p argument, the
patch command has peculiar behavior. I assumed that without -p, %patch
would not inherit that behavior, and so would %autosetup without -p.
Is this accurate? Or does %autosetup (or %patch) have an actual default
for -p?
Hi.
%autosetup calls %autopatch and passes -p only if used
https://github.com/rpm-software-management/rpm/blob/rpm-4.18.1-release/macros.in#L1279
%autopatch calls %__apply_patch and passes -p only if used
https://github.com/rpm-software-management/rpm/blob/rpm-4.18.1-release/macros.in#L1262
%__apply_patch calls %__scm_apply_%{__scm} and passes options as given
https://github.com/rpm-software-management/rpm/blob/rpm-4.18.1-release/macros.in#L1230
Default value for %{__scm} is patch
https://github.com/rpm-software-management/rpm/blob/rpm-4.18.1-release/macros.in#L1159
%__scm_apply_patch calls the %{__patch} program and passes -p only if used
Default for %{__patch} is ... probably /usr/bin/patch
https://github.com/rpm-software-management/rpm/blob/rpm-4.18.1-release/macros.in#L47
---------------
Conclusion: No default. %autosetup without -p calls patch without
-p. Assuming you don't use %autosetup with non-default -S.
Thank you, that was my tentative conclusion as well. Given the weird
-p-less behavior, shouldn't we encourage to use -p1 (to match git) or
-p0 (to match Subversion/CVS/RCS)?
I prefer to use explicit -p1 or even -S git_am anyway, so I don't have a
preference about the default. If things were designed today, making -p1 the
default would make sense, but changing the default now will break all the
things that only work because of the current behavior -- please don't.
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
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