In regard to: Re: determine package arch without/before building package?,...:

Given a spec file foo.spec, is there a way use rpmbuild or rpm to
determine what the package architecture will be without (or before)
actually building the package?

I know I could use sed or grep on the spec file looking for BuildArch,
but I'm wondering if there's a way to essentially run the equivalent of
a macro --eval query against a spec file.


The "recommended" way is this

        ./rpm -q --qf '%{arch}\n' --specsrpm rpm.spec
        x86_64

Thanks Jeff, that worked perfectly, at least with RPM 5.x.

Tim
--
Tim Mooney                                             tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
User Communication List                             rpm-users@rpm5.org

Reply via email to