Re: About rpm --querytags option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/01/2008, Robert Wuest <rwuestfc@xxxxxxxxx> wrote:
> This brings to mind a problem I had to deal with not too long ago.
>
> How does one find the spec file a package is built from?
>
> Is there a more reliable / faster way than something like this?
>
> rpm -qlp package.src.rpm | egrep '\.spec$'

Faster? No.

More reliable? Yes, but only with more complex code. Although it might
be that nowadays no src.rpm contains more than one spec file anymore,
and the complexity would not be worth the effort. In theory, you could
verify that no Source/Patch file ends with ".spec". The spec filename
must not be found in the arrays "[%{source}\n]" and "[%{patch}\n]",
but is included in "[%{filenames}\n]" (which is the same as the -qlp
output). Example:

$ for f in $(rpm -qp sylpheed-2.3.1-0.1.3.EL.src.rpm --qf
"[%{patch}\n]") ; do echo $f ; done
sylpheed-2.3.1-CVE-2007-2958.patch
sylpheed-2.3.1-escaped-quotes.patch
sylpheed-2.3.1-pgpmime-signed-compose.patch
sylpheed-2.3.1-apop-cve-2007-1558.patch
sylpheed-2.2.5-prefs_common.patch
sylpheed-2.3.1-certsdir-rhel.patch
sylpheed-2.2.7-desktop.patch
sylpheed-2.2.3-defs.h.patch

$ for f in $(rpm -qp sylpheed-2.3.1-0.1.3.EL.src.rpm --qf
"[%{source}\n]") ; do echo $f ; done
sylpheed.1
sylpheed-2.3.1.tar.bz2

But:

$ for f in $(rpm -qp sylpheed-2.3.1-0.1.3.EL.src.rpm --qf
"[%{filenames}\n]"); do echo $f ; done
sylpheed-2.2.3-defs.h.patch
sylpheed-2.2.5-prefs_common.patch
sylpheed-2.2.7-desktop.patch
sylpheed-2.3.1-CVE-2007-2958.patch
sylpheed-2.3.1-apop-cve-2007-1558.patch
sylpheed-2.3.1-certsdir-rhel.patch
sylpheed-2.3.1-escaped-quotes.patch
sylpheed-2.3.1-pgpmime-signed-compose.patch
sylpheed-2.3.1.tar.bz2
sylpheed.1
sylpheed.spec

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux