Bug 1308133 - [Doc] rpmspec help does not match man page; man page needs usage examples (was: rpmspec fails to parse source rpm)
[Doc] rpmspec help does not match man page; man page needs usage examples (wa...
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Documentation, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-13 17:29 EST by Steve
Modified: 2016-05-09 08:49 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-09 08:49:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve 2016-02-13 17:29:43 EST
Description of problem:

$ rpmspec -q --srpm firefox-44.0.1-2.fc23.src.rpm
error: line 1: Unknown tag: ����
error: query of specfile firefox-44.0.1-2.fc23.src.rpm failed, can't parse

Version-Release number of selected component (if applicable):
rpm-build-4.13.0-0.rc1.11.fc23.x86_64
Comment 1 Ľuboš Kardoš 2016-02-19 08:31:32 EST
This is not a bug. Tool rpmspec is for querying spec files and not for querying binary srpm or rpm files. From man rpmspec:

   rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ...

Notice that argument has to be a SPEC_FILE

The meaning of "--srpm" option is different. It means query srpm which would be created from an given spec file. And --rpms means query rpms which would be created from an given spec file. Option --rpms is used by default. 

For querying srpms and rpms use rpm tool e. g.:
$ rpm -qp  firefox-44.0.1-2.fc23.src.rpm
firefox-44.0.1-2.fc23.armv7hl
Comment 2 Steve 2016-02-19 12:47:57 EST
(In reply to Ľuboš Kardoš from comment #1)
> This is not a bug. Tool rpmspec is for querying spec files and not for
> querying binary srpm or rpm files. From man rpmspec:
> 
>    rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ...
> 
> Notice that argument has to be a SPEC_FILE
> 
> The meaning of "--srpm" option is different. It means query srpm which would
> be created from an given spec file. And --rpms means query rpms which would
> be created from an given spec file. Option --rpms is used by default. 
> 
> For querying srpms and rpms use rpm tool e. g.:
> $ rpm -qp  firefox-44.0.1-2.fc23.src.rpm
> firefox-44.0.1-2.fc23.armv7hl

That all needs to go into the man page, not in a bug report. And the man page needs to have usage examples.

Further, the help option does not show "SPEC_FILE":
$ rpmspec --help
Usage: rpmspec [OPTION...]
...

That needs to match the man page:
"rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ..."

Reopening as a documentation bug.
Comment 3 Ľuboš Kardoš 2016-05-09 08:49:16 EDT
I modified rpmspec man page upstream:

https://github.com/rpm-software-management/rpm/commit/1c5c9fc347f47505c99d6f4abac79069fbe680cf

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