Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 19399

Summary: rpm can't handle nested `%ifarch' and `%if %{var}' constructs
Product: [Retired] Red Hat Raw Hide Reporter: Michael Tokarev <mjt>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-19 20:12:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 18868    

Description Michael Tokarev 2000-10-19 20:06:35 UTC
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 20:08:57 UTC
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 20:22:28 UTC

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