Bug 494422 - rpmlint does not find empty "Requires:" tag
rpmlint does not find empty "Requires:" tag
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpmlint (Show other bugs)
10
noarch Linux
low Severity low
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-06 15:51 EDT by Edwin ten Brink
Modified: 2009-04-06 16:19 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-06 16:19:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Edwin ten Brink 2009-04-06 15:51:10 EDT
rpmlint-0.85-2.fc10.noarch does not find an empty "Requires:" tag (suggesting automatic requires), but rpm refuses to build with "error: line xx: Empty tag: Requires:".

I'm not sure if this is a missing feature of rpmlint, or that rpmbuild is incorrect (i.e. should accept an empty Requires: tag for auto requires).

From http://fedoraproject.org/wiki/PackageMaintainers/CreatingPackageHowTo#Spec_file_pieces_explained :

"Requires: A comma-separate list of packages that are required when the program is installed. Note that the list of packages for Requires (what's required when running) and BuildRequires (what's required to build the binary RPM) are independent; a package may be in one list but not the other, or it could be in both. The "Requires" list is automatically determined by rpm, so normally you don't need to put anything here. But if you want to highlight some specific packages as being required, or require a package that rpm can't detect should be required, then add it here."
Comment 1 Ville Skyttä 2009-04-06 16:19:41 EDT
Empty "Requires:" is a specfile syntax error, therefore it does not make much sense to create a specific check in rpmlint - it'll be rejected by rpmbuild anyway.  Current versions of rpmlint (0.87 will appear in the next update batch for F-10) will pass through possible error messages from rpm though:

$ rpmlint /home/scop/tmp/noreplace-perms-1.1.spec
[...]
/home/scop/tmp/noreplace-perms-1.1.spec: E: specfile-error error: line 7: Empty tag: Requires:
[...]

The information in Wiki is badly worded - it doesn't mean that one should leave the Requires tag empty, but that the tag shouldn't in cases where it's not needed be included at all.  I reworded it, hopefully it's clearer now:

https://fedoraproject.org/w/index.php?title=How_to_create_an_RPM_package&diff=95521&oldid=90539

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