[Rpm-maint] [PATCH] fix %autopatch when patch do not exist

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Fri Sep 18 09:50:35 UTC 2015


Heya,

On 17 September 2015 at 09:46, Thierry Vignaud
<thierry.vignaud at gmail.com> wrote:
> Hi
>
> The attached patch fixes %autopatch (& thus %autosetup too) when a
> patch doesn't actually exist.
>
> Indeed, unlike Mageia's %apply_patches which inspired it, %autopatch
> continues instead of exiting when it fails to apply a patch because it
> doesn't exists. Eg:
>
> + /usr/bin/cat /home/tv/rpmbuild/SOURCES/test.patch2
> + /usr/bin/patch -p1 -s
> /usr/bin/cat: /home/tv/rpmbuild/SOURCES/test.patch2: No such file or directory
> + /usr/bin/cat /home/tv/rpmbuild/SOURCES/test.patch
> + /usr/bin/patch -p1 -s
>
> With the attached patch, the build stops as soon as the error is seen.
>
> Please apply.
> It should be backported to 4.12.x & 4.13.x branches too
>

So this %autopatch thing is a bit useless to me at the moment,
specifically because of the requirement to have patches in
rpmbuild/SOURCES/.

And it's not nice to operate against packaging committed to git.

I have a git tree with foo.spec & foo.patch. And use mock to build it:

$ mock --buildsrpm --source=./ --spec=foo.spec --results=results/

%autopatch / %autosetup then looks for patches in the wrong location.
Am I missing something to use both %autopatch and patches from the
same location as the spec file?

-- 
Regards,

Dimitri.
98 sleeps till Christmas

https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.


More information about the Rpm-maint mailing list