Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
Thanks,
On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto sergio@serjux.com wrote:
Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
If you need to do per-patch application, don't use %autosetup.
Use individual %patchN macros or use a strategy like this:
%patch -p1 -P 1 2 3 4 5 %if 0%{?fedora} >= 30 %patch6 -p1 -b .poppler.0.73.0 %endif
On Sat, 2019-02-23 at 19:29 -0500, Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto sergio@serjux.com wrote:
Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
If you need to do per-patch application, don't use %autosetup.
Use individual %patchN macros or use a strategy like this:
%patch -p1 -P 1 2 3 4 5 %if 0%{?fedora} >= 30 %patch6 -p1 -b .poppler.0.73.0 %endif
Hi, Just a note we can disable automatic patch application with -N [1] But I just want disable automatic patch just for one patch ...
Thanks for your reply.
[1] http://rpm.org/user_doc/autosetup.html -N disables automatic patch application if necessary for some reason. If %autosetup is called with -N, the patch-application phase can be manually invoked with %autopatch macro.
Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto sergio@serjux.com wrote:
Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
If you need to do per-patch application, don't use %autosetup.
Use individual %patchN macros or use a strategy like this:
%patch -p1 -P 1 2 3 4 5 %if 0%{?fedora} >= 30 %patch6 -p1 -b .poppler.0.73.0 %endif
Alternately, if you move the %if condition to the Patch6: header you can let %autosetup handle things still. In other words:
... Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif ... %prep %autosetup -n GDCM-%{version} -S git ...
I don't see anything in the guidelines section on patches about avoiding such a conditional, but it's possible there's a more general rule which I'm forgetting. If so, I'm happy to be reminded. :)
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto sergio@serjux.com wrote:
Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
If you need to do per-patch application, don't use %autosetup.
Use individual %patchN macros or use a strategy like this:
%patch -p1 -P 1 2 3 4 5 %if 0%{?fedora} >= 30 %patch6 -p1 -b .poppler.0.73.0 %endif
Alternately, if you move the %if condition to the Patch6: header you can let %autosetup handle things still. In other words:
... Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif ... %prep %autosetup -n GDCM-%{version} -S git ...
I don't see anything in the guidelines section on patches about avoiding such a conditional, but it's possible there's a more general rule which I'm forgetting. If so, I'm happy to be reminded. :)
The general rule is to avoid conditionals around Source and Patch lines... Though I can't find the reference in the guidelines over it, the idea is that the source package contains all the source content from Dist-Git always.
On Sat, 2019-02-23 at 19:45 -0500, Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto sergio@serjux.com wrote:
Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
If you need to do per-patch application, don't use %autosetup.
Use individual %patchN macros or use a strategy like this:
%patch -p1 -P 1 2 3 4 5 %if 0%{?fedora} >= 30 %patch6 -p1 -b .poppler.0.73.0 %endif
Alternately, if you move the %if condition to the Patch6: header you can let %autosetup handle things still. In other words:
... Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif ... %prep %autosetup -n GDCM-%{version} -S git ...
I don't see anything in the guidelines section on patches about avoiding such a conditional, but it's possible there's a more general rule which I'm forgetting. If so, I'm happy to be reminded. :)
The general rule is to avoid conditionals around Source and Patch lines... Though I can't find the reference in the guidelines over it, the idea is that the source package contains all the source content from Dist-Git always.
src.rpm can't have conditionals, I don't know where it is write , but makes sense , f28 .src.rpm will fail to build on F30 ...
Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Alternately, if you move the %if condition to the Patch6: header you can let %autosetup handle things still. In other words:
... Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif ... %prep %autosetup -n GDCM-%{version} -S git ...
I don't see anything in the guidelines section on patches about avoiding such a conditional, but it's possible there's a more general rule which I'm forgetting. If so, I'm happy to be reminded. :)
The general rule is to avoid conditionals around Source and Patch lines... Though I can't find the reference in the guidelines over it, the idea is that the source package contains all the source content from Dist-Git always.
Yeah, I know it can cause issues if the srpm is generated differently across systems. I thought that it would be noted in the guidelines if it was generally frowned upon. When I didn't see it, I thought I'd mention it and see if someone could point to where it was covered.
If it's not covered but should be a general rule, perhaps a patch to the guidelines can come out of this discussion.
On Sat, 23 Feb 2019 19:45:57 -0500 Neal Gompa ngompa13@gmail.com wrote:
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Neal Gompa wrote:
On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto sergio@serjux.com wrote:
Sorry for the mistake I just fixed the subject ...
Hi,
%autosetup -n GDCM-%{version} -S git -N %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %if 0%{?fedora} > 29 %patch6 -p1 -b .poppler.0.73.0 %endif
Is this the correct way to apply one patch only in F30 ? , i.e. I need patch 6 not be applied on F28 and epel7, how I do that when we are using %autosetup ?
If you need to do per-patch application, don't use %autosetup.
Use individual %patchN macros or use a strategy like this:
%patch -p1 -P 1 2 3 4 5 %if 0%{?fedora} >= 30 %patch6 -p1 -b .poppler.0.73.0 %endif
Alternately, if you move the %if condition to the Patch6: header you can let %autosetup handle things still. In other words:
... Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif ... %prep %autosetup -n GDCM-%{version} -S git ...
I don't see anything in the guidelines section on patches about avoiding such a conditional, but it's possible there's a more general rule which I'm forgetting. If so, I'm happy to be reminded. :)
The general rule is to avoid conditionals around Source and Patch lines... Though I can't find the reference in the guidelines over it, the idea is that the source package contains all the source content from Dist-Git always.
AFAIK there is a guideline that prohibits arch-specific Patch/Source definitions.
Dan
"DH" == Dan Horák dan@danny.cz writes:
DH> AFAIK there is a guideline that prohibits arch-specific Patch/Source DH> definitions.
I keep thinking there is one as well, and I should know these guidelines about as well as anyone. But I've looked and can't actually find it. I looked in some old versions of the wiki documents just to see if somehow it used to be there and was removed at some point, and... that seems to be the case.
https://fedoraproject.org/w/index.php?title=Packaging:Guidelines&diff=pr...
Or, in the git repo which has all of the wiki history: https://pagure.io/packaging-committee/c/5c2f228a50295abcc875e557715c30b00523...
And I think that I must simply have removed that section in error. It's so easy to do that when working on the wiki. I will restore it, and it should appear in the online copy of the guidelines soon.
- J<
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif
*Never* do this. If you do this, your different SRPM's have different content, and any attempt to port the content to a release not included by the "%if" will not have the patch referred to. It's like generating .gitignore files dynamically, it's a horrible practice though it's technically feasible.
Hi,
Nico Kadel-Garcia wrote:
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif
*Never* do this. If you do this, your different SRPM's have different content, and any attempt to port the content to a release not included by the "%if" will not have the patch referred to.
Yes, it has drawbacks. :)
How significant those are depend upon whether we consider dist-git or generated srpm files as the canonical source. If it's dist-git, then this is much less of an issue than if it's the srpm files.
That's not to say that even if dist-git is canonical that we want to allow srpm's to differ across releases and/or any other conditions an %if allows.
I did expect the guidelines might contain something on the subject. I know it's come up in the past. Part of the reason I put it out here was to see if it jogged any memories of whether: a) it's in the guidelines and I have overlooked it; b) it was previously in the guidelines and lost to time; or c) it's just one of those things which long-time rpm folks pick up over the years.
On Sun, Feb 24, 2019 at 9:43 PM Todd Zullinger tmz@pobox.com wrote:
Hi,
Nico Kadel-Garcia wrote:
On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger tmz@pobox.com wrote:
Patch5: number5.patch %if 0%{?fedora} > 29 Patch6: fedora-30-and-above.patch %endif
*Never* do this. If you do this, your different SRPM's have different content, and any attempt to port the content to a release not included by the "%if" will not have the patch referred to.
Yes, it has drawbacks. :)
How significant those are depend upon whether we consider dist-git or generated srpm files as the canonical source. If it's dist-git, then this is much less of an issue than if it's the srpm files.
That's not to say that even if dist-git is canonical that we want to allow srpm's to differ across releases and/or any other conditions an %if allows.
I did expect the guidelines might contain something on the subject. I know it's come up in the past. Part of the reason I put it out here was to see if it jogged any memories of whether: a) it's in the guidelines and I have overlooked it; b) it was previously in the guidelines and lost to time; or c) it's just one of those things which long-time rpm folks pick up over the years.
I'm pretty sure this rule has existed in the guidelines before. But with everything juggled around from the wiki into the new Antora-based system, it probably got lost somewhere...
"NG" == Neal Gompa ngompa13@gmail.com writes:
NG> If you need to do per-patch application, don't use %autosetup.
Note that it is technically possible to conditionally hide patches from %autosetup by removing them from the patches table.
At one point in my macro experiments I wrote a macro to do this, but I didn't think it had sufficiently general applicability to be worth sending anywhere or including in redhat-rpm-macros.
- J<
On Mon, 2019-02-25 at 12:52 -0600, Jason L Tibbitts III wrote:
"NG" == Neal Gompa ngompa13@gmail.com writes:
NG> If you need to do per-patch application, don't use %autosetup.
Note that it is technically possible to conditionally hide patches from %autosetup by removing them from the patches table.
At one point in my macro experiments I wrote a macro to do this, but I didn't think it had sufficiently general applicability to be worth sending anywhere or including in redhat-rpm-macros.
It would be great to conditionally hide patches from %autosetup
On Tue, 26 Feb 2019 at 23:09, Sérgio Basto sergio@serjux.com wrote: [..]
It would be great to conditionally hide patches from %autosetup
You can always write proper patch which will be conditional on oroiginal source code. In practice uising any arch dependent apply whole patches is more like symptom of JFDI than proper patching. Such patches are usually refused by source code maintainers. So instead thinking about bending %autsetup just start writing proper patches.
kloczek
* Sérgio Basto:
On Mon, 2019-02-25 at 12:52 -0600, Jason L Tibbitts III wrote:
> "NG" == Neal Gompa ngompa13@gmail.com writes:
NG> If you need to do per-patch application, don't use %autosetup.
Note that it is technically possible to conditionally hide patches from %autosetup by removing them from the patches table.
At one point in my macro experiments I wrote a macro to do this, but I didn't think it had sufficiently general applicability to be worth sending anywhere or including in redhat-rpm-macros.
It would be great to conditionally hide patches from %autosetup
Is this really a good idea? As a result, it can be very difficult to modify the changed files again in a subsequent patch.
Thanks, Florian
"FW" == Florian Weimer fweimer@redhat.com writes:
FW> Is this really a good idea? As a result, it can be very difficult FW> to modify the changed files again in a subsequent patch.
That would be the case for any conditionally applied patch, and wouldn't really argue against a convenience macro to allow %autosetup to still be used. But still, this kind of patches should be rare for many good reasons which is why I never tried to get such a macro into our RPM configuration.
- J<
Le mercredi 27 février 2019 à 11:21 -0600, Jason L Tibbitts III a écrit :
"FW" == Florian Weimer fweimer@redhat.com writes:
FW> Is this really a good idea? As a result, it can be very difficult FW> to modify the changed files again in a subsequent patch.
That would be the case for any conditionally applied patch, and wouldn't really argue against a convenience macro to allow %autosetup to still be used. But still, this kind of patches should be rare for many good reasons which is why I never tried to get such a macro into our RPM configuration.
The whole autosetup patching thing does not really work if you have more than one SOURCE than needs patching.
Last time I looked at it, I came to the conclusion that it would just be nicer to define a variable with the list and order of patches to apply to a particular source (an undefined variable meaning everything like now).
And once you have that, you get conditional patching for free, since the variable can be set inside a conditional block.
That nicely dissociates the patches recorded in the srpm (everything) from the patches effectively applied. Quite useful for bootstrap- specific patches for example
Regards,
packaging@lists.fedoraproject.org