Blame SOURCES/0024-builddep-Warning-when-using-macros-with-source-rpms-.patch

888f85
From 0afd47edc60fb7fe5c72fa64bca413bdce82d900 Mon Sep 17 00:00:00 2001
888f85
From: Jan Kolarik <jkolarik@redhat.com>
888f85
Date: Thu, 11 Aug 2022 14:12:06 +0200
888f85
Subject: [PATCH] builddep: Warning when using macros with source rpms
888f85
 (RhBug:2077820)
888f85
888f85
= changelog =
888f85
type: bugfix
888f85
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2077820
888f85
---
888f85
 doc/builddep.rst    | 2 +-
888f85
 plugins/builddep.py | 4 ++++
888f85
 2 files changed, 5 insertions(+), 1 deletion(-)
888f85
888f85
diff --git a/doc/builddep.rst b/doc/builddep.rst
888f85
index 6e9bde6..97eb823 100644
888f85
--- a/doc/builddep.rst
888f85
+++ b/doc/builddep.rst
888f85
@@ -31,7 +31,7 @@ All general DNF options are accepted, see `Options` in :manpage:`dnf(8)` for det
888f85
     Show this help.
888f85
 
888f85
 ``-D <macro expr>, --define <macro expr>``
888f85
-    Define the RPM macro named `macro` to the value `expr` when parsing spec files.
888f85
+    Define the RPM macro named `macro` to the value `expr` when parsing spec files. Does not apply for source rpm files.
888f85
 
888f85
 ``--spec``
888f85
     Treat arguments as .spec files.
888f85
diff --git a/plugins/builddep.py b/plugins/builddep.py
888f85
index e3da012..e7dac43 100644
888f85
--- a/plugins/builddep.py
888f85
+++ b/plugins/builddep.py
888f85
@@ -204,6 +204,10 @@ class BuildDepCommand(dnf.cli.Command):
888f85
             err = _("Not all dependencies satisfied")
888f85
             raise dnf.exceptions.Error(err)
888f85
 
888f85
+        if self.opts.define:
888f85
+            logger.warning(_("Warning: -D or --define arguments have no meaning "
888f85
+                             "for source rpm packages."))
888f85
+
888f85
     def _spec_deps(self, spec_fn):
888f85
         try:
888f85
             spec = rpm.spec(spec_fn)
888f85
-- 
888f85
2.37.1
888f85