Bug 19399 - rpm can't handle nested `%ifarch' and `%if %{var}' constructs
rpm can't handle nested `%ifarch' and `%if %{var}' constructs
Status: CLOSED DUPLICATE of bug 14463
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
Depends On:
Blocks: 18868
  Show dependency treegraph
 
Reported: 2000-10-19 16:06 EDT by Michael Tokarev
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-19 16:12:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Tokarev 2000-10-19 16:06:35 EDT
Funny one that caused e.g. unability to properly use %ifs for kernel
rpms.  I don't know if this is reported, but I see this bug for very
long time already, and query for 'rpm' and 'arch' didn't find any
refs for this.

Here it is:

 %define var 1
 %ifarch i386
 %if %{var}
 echo var
 %endif
 %endif

For this, rpm will complain "parseExpressionBoolean returns -1" to the
'%if %{var}' line.  If the order is changed (i.e. %ifarch inside %ifvar),
all works fine.

This bug caused funny bug in kernel rpm.  Redhat places kernel-sources
and kernel-headers to one package by default, but there is a define in
kernel.spec (%define headersinsource 1) that can be changed.  Ok,
I see this thing in spec:

  %files source
  ...
  %{!?headersinsource:%files headers}
  ...

This wont work (no kernel-headers produced even if headersinsource is
set to 0).  If I change this to

  %if ! %{headersinsource}
  %files headers
  %endif

rpm will build for i386 and -headers will be created, but it will
complain to the line `%if ! %{headersinsource}' for e.g. i686
(with the same message).  So, there is no ability currently exists
to make kernel-headers package, while at least one of this bugs not
fixed.

I don't know why it won't build -headers in the first place -- line
  %{!?headersinsource:%files headers}
looks strange to me.  But I can't say that this is an rpm bug also,
as this at least not documented anywhere. So there is may be one bug
(nested %ifs) or two bugs.
Comment 1 Michael Tokarev 2000-10-19 16:08:57 EDT
BTW, probably this is the same thing as was with %define inside false %ifarch
that was fixed. (see bug 11485, 
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=11485 ).
Comment 2 Jeff Johnson 2000-10-19 16:22:28 EDT

*** This bug has been marked as a duplicate of 14463 ***

Note You need to log in before you can comment on or make changes to this bug.