On Fri, Feb 25, 2005 at 12:01:34PM -0600, Tom 'spot' Callaway wrote: > On Fri, 2005-02-25 at 10:31 -0500, Chuck R. Anderson wrote: > >On Thu, Feb 24, 2005 at 05:28:38PM -0600, Tom 'spot' Callaway wrote: > >> rpm -q --qf "%{version}\n" `rpm -qf /etc/redhat-release` > > > >Instead of hard-coding the filename, how about using the Provides: > >that is in the package? > > > >rpm -q --whatprovides --qf "%{version}\n" redhat-release > > We can't use "--qf "%{version}\n" in the macro. Problems with %{version} aside, my point was that Jeff Johnson mentioned to me once that the best way to get the distro version package is to get what Provides: redhat-release, not hardcoding either /etc/redhat-release or the package name redhat-release. So: rpm -q --whatprovides redhat-release rather than: rpm -qf /etc/redhat-release