RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Specfile query outputs error messages for "missing" patches

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 02 Dec 2009 - 22:30:40 CET
Message-id: <81D5EFC5-6118-45DE-BE54-67A1BA3AD571@mac.com>

On Nov 25, 2009, at 8:54 PM, Matthew Dawkins wrote:

> rpm -q --specfile F/zsh.spec 
> error: File /home/unity/src/rpm/SOURCES/zsh-4.3.10-man_lzma.patch: No such file or directory
> error: File /home/unity/src/rpm/SOURCES/zsh-4.3.10-fix_accept_menu_selection.patch: No such file or directory
> error: File /home/unity/src/rpm/SOURCES/zsh-4.3.10-allow_exit_complition_list.patch: No such file or directory
> zsh-4.3.10-3-unity2009
> zsh-doc-4.3.10-3-unity2009
> zsh-__restore__-4.3.10-3-unity2009
> 
> The same bug was reported here:
> https://bugzilla.redhat.com/show_bug.cgi?id=487855


The short answer is that this is a macro configuration issue and cannot be fixed in RPM.

Here's why:

	[jbj@fedora10 wdj]$ rpm -q --specfile /tmp/time.spec 
	error: File /usr/src/rpm/SOURCES/time-1.7-destdir.patch: No such file or directory
	error: File /usr/src/rpm/SOURCES/time-1.7-verbose.patch: No such file or directory
	time-1.7-37.fc11.i686

	[jbj@fedora10 wdj]$ rpm -q --undefine 'patch' --specfile /tmp/time.spec 
	time-1.7-37.fc11.i686

i.e. the error message is coming from a %patch macro expansion, not from
the spec file parser.

So the issue reported at #487855 was actually fixed quite some years ago @rpm5.org
around the time that source/patch/icon fetching was added.

However, %patch is a macro, and the consensus opinion @rpm5.org is to
have %patch _BOTH_ ways, compiled into rpmbuild as well as overloaded
as a macro.

During macro expansion there is severely limited context which is not easily
altered.

And deleting the macro on peculier code paths like --specfile
is kinda nutso because it defeats the whole purpose of
	Have it your own way!

In fact, you already can "Have it your own way!" and get rid of the error message
by configuring rpm differently.

Note that that also explains why missing sources do not lead to errors, 
the %patch macro is leading to an eror.

hth

73 de Jeff
Received on Wed Dec 2 22:31:01 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.