Bug 1308133

Summary: [Doc] rpmspec help does not match man page; man page needs usage examples (was: rpmspec fails to parse source rpm)
Product: [Fedora] Fedora Reporter: Steve <y9t7sypezp>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jzeleny, lkardos, novyjindrich, packaging-team-maint, pknirsch
Target Milestone: ---Keywords: Documentation, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-09 12:49:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Steve 2016-02-13 22:29:43 UTC
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 13:31:32 UTC
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 17:47:57 UTC
(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 12:49:16 UTC
I modified rpmspec man page upstream:

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