Bug 1308133 - [Doc] rpmspec help does not match man page; man page needs usage examples (was: rpmspec fails to parse source rpm)
Summary: [Doc] rpmspec help does not match man page; man page needs usage examples (wa...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-13 22:29 UTC by Steve
Modified: 2016-05-09 12:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-09 12:49:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


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