Skip to content

Commit

Permalink
builddep: Warning when using macros with source rpms (RhBug:2077820)
Browse files Browse the repository at this point in the history
= changelog =
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2077820
  • Loading branch information
jan-kolarik authored and kontura committed Aug 15, 2022
1 parent 313470b commit e37e42a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/builddep.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ All general DNF options are accepted, see `Options` in :manpage:`dnf(8)` for det
Show this help.

``-D <macro expr>, --define <macro expr>``
Define the RPM macro named `macro` to the value `expr` when parsing spec files.
Define the RPM macro named `macro` to the value `expr` when parsing spec files. Does not apply for source rpm files.

``--spec``
Treat arguments as .spec files.
Expand Down
4 changes: 4 additions & 0 deletions plugins/builddep.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ def _src_deps(self, src_fn):
err = _("Not all dependencies satisfied")
raise dnf.exceptions.Error(err)

if self.opts.define:
logger.warning(_("Warning: -D or --define arguments have no meaning "
"for source rpm packages."))

def _spec_deps(self, spec_fn):
try:
spec = rpm.spec(spec_fn)
Expand Down

0 comments on commit e37e42a

Please sign in to comment.