Bug 19399 - rpm can't handle nested `%ifarch' and `%if %{var}' constructs
Summary: rpm can't handle nested `%ifarch' and `%if %{var}' constructs
Status: CLOSED DUPLICATE of bug 14463
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
Depends On:
Blocks: 18868
TreeView+ depends on / blocked
Reported: 2000-10-19 20:06 UTC by Michael Tokarev
Modified: 2007-04-18 16:29 UTC (History)
0 users

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

Attachments (Terms of Use)

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

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

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

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 ***

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