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

Bug 30650

Summary: Querying a specfile doesn't work properly
Product: [Retired] Red Hat Linux Reporter: Peter Bowen <pzbowen+rhbeta>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-03-05 15:39:41 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:

Description Peter Bowen 2001-03-05 15:39:32 UTC
If you do 

rpm --query --specfile foo.spec --queryformat  \
"%{NAME}\t %{EXCLUDEARCH}\t %{EXCLUSIVEARCH}\n"

where foo has an exclude arch option, rpm will show "(none)" for both
exclusive arch and excludearch on all packages.  I used php.spec from Red
Hat 7.0 as the test.  This occurs with the rpm distributed with RHL6.2, the
6.2 errata, 7.0, and wolverine.

Comment 1 Jeff Johnson 2001-03-05 16:31:38 UTC
This problem has the same root cause as #27859, as ExcludeArch: is part of a
buildRestrictions
header, not the parsed package header.

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

Comment 2 Peter Bowen 2001-03-05 22:41:07 UTC
Is there a  known work-around?  I understand that this is due to the recursive
nature of specfile parsing, but it seems like there should be some way to dump
the buildarch info.

Comment 3 Jeff Johnson 2001-03-05 22:49:17 UTC
Sure, grep is your friend. Try
	grep -i "^ExcludeArch:" php.spec
and variants thereof.