Bug 441808 - [RFE]: provide API to SPEC file parser
[RFE]: provide API to SPEC file parser
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: packaging-team-maint
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2008-04-10 05:32 EDT by Michal Nowak
Modified: 2013-03-07 21:04 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-03-07 04:40:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michal Nowak 2008-04-10 05:32:19 EDT
Description of problem:

For "third party tools" (like TPS) there's sometimes need to access to the
resulting string from Release line in SPEC file. 

Input is SPEC file with this lines

%define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}}
Release: 3%{_extra_release}.1

Output is .el5_1.1 or The Right String.

See this bug 441672.

Version-Release number of selected component (if applicable):

How reproducible:

Actual results:
no exported API

Expected results:
exported API
Comment 1 Panu Matilainen 2008-04-10 06:51:38 EDT
Sure there's an API of sorts for this in librpmbuild (even if it's not exactly
very sane or friendly to use), but just for digging out a release number from a
spec you can use a spec query, for example:

[pmatilai@localhost RHEL-5]$ rpm -q --define "%dist .el5" --specfile --qf
"%{name} %{version} %{release}\n" virt-manager.spec 
virt-manager 0.5.3 7.el5
virt-manager-debuginfo 0.5.3 7.el5

NOTABUG in the sense that couple of ways to access this data do exist. There are
plans to provide a saner API for the build parts for rpm (including python
bindings), but that's way way out of scope for RHEL 5.

Note You need to log in before you can comment on or make changes to this bug.