Re: %autosetup and conditional patching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 23 Feb 2019 19:45:57 -0500
Neal Gompa <ngompa13@xxxxxxxxx> wrote:

> On Sat, Feb 23, 2019 at 7:42 PM Todd Zullinger <tmz@xxxxxxxxx> wrote:
> >
> > Neal Gompa wrote:
> > > On Sat, Feb 23, 2019 at 7:25 PM Sérgio Basto <sergio@xxxxxxxxxx>
> > > 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
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux