RPM Community Forums

Mailing List Message of <rpm-devel>

Re: %patch fully broken

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 22 Jul 2007 - 00:19:08 CEST
Message-Id: <159D2F69-2F2F-4724-B45D-F1F29C74D436@mac.com>

On Jul 21, 2007, at 5:38 PM, Ralf S. Engelschall wrote:

> I recognized that RPM 5's %patch seems to not work. The "%patch"
> definition in RPM 5's "macros" file actually seems to be fully  
> broken to
> me:
>
> | %_patch_file    %{P:%{-P:%{-P*}}%{!-P:%%PATCH0}}
> | %_patch_suffix  %{-b:-b --suffix %{-b*}}%{-z:--suffix %{-z*}}
> |
> | %__patch_display echo "Patch #%{-P:%{-P*}}%{!-P:0} (%{basename:% 
> _patch_file}):"
> | %__patch_apply   %{uncompress:%_patch_file} | %{__patch} -s %{-p:- 
> p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %_patch_suffix %{-R} %{-E}
> |
> | %patch(b:p:P:REz:F:d:) %{__patch_display} ; %{__patch_apply} \
> | %{nil}
>
> It accepts all options in %patch but because of indirections in the
> expansions all the options are just lost. Example:
>
> | $ ./rpm --eval '%patch -p123 -d foo -P4'
> | error: File %PATCH0: No such file or directory
> | echo "Patch #0 (%PATCH0):" ; /bin/cat %PATCH0 | /usr/opkg/bin/ 
> patch -s
>
> Do I miss something? How is this supposed to work with the options?
>

The %patch worked for me on the 3 packages I built when I enabled.

The reported problem(s) (from Mark) so far have been
     1) %PATCH001 != %PATCH1	leading zeros are now stripped
     2) as %patch was originally written, multiline expansions prevented
             #%patchNN
         commenting.

I will double check %patch as soon as I can build rpm-5.0.

73 de Jeff
Received on Sun Jul 22 00:19:13 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.