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

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