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.
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 ***
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.
Sure, grep is your friend. Try grep -i "^ExcludeArch:" php.spec and variants thereof.