dcavalca / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone

Blame SOURCES/0011-Better-descriptions-for-infinite-aliases-recursion-RhBug1680488.patch

878112
From f89ac56ef0ee7a349e0389913a510ba194022e95 Mon Sep 17 00:00:00 2001
878112
From: Pavla Kratochvilova <pkratoch@redhat.com>
878112
Date: Thu, 23 May 2019 14:32:32 +0200
878112
Subject: [PATCH 1/2] Print the whole alias definition in case of infinite
878112
 recursion (RhBug:1680488)
878112
878112
https://bugzilla.redhat.com/show_bug.cgi?id=1680488
878112
---
878112
 dnf/cli/commands/alias.py | 3 ++-
878112
 1 file changed, 2 insertions(+), 1 deletion(-)
878112
878112
diff --git a/dnf/cli/commands/alias.py b/dnf/cli/commands/alias.py
878112
index 10f58867ca..d3e6e4326e 100644
878112
--- a/dnf/cli/commands/alias.py
878112
+++ b/dnf/cli/commands/alias.py
878112
@@ -151,7 +151,8 @@ def list_alias(self, cmd):
878112
         try:
878112
             args = self.aliases_base._resolve(args)
878112
         except dnf.exceptions.Error as e:
878112
-            logger.error(_('%s, alias %s'), e, cmd)
878112
+            logger.error(
878112
+                _('%s, alias %s="%s"'), e, cmd, (' ').join(self.aliases_base.aliases[cmd]))
878112
         else:
878112
             print(_("Alias %s='%s'") % (cmd, " ".join(args)))
878112
 
878112
878112
From ccd4213da366d49f6f84847fa2ccdb890d257930 Mon Sep 17 00:00:00 2001
878112
From: Pavla Kratochvilova <pkratoch@redhat.com>
878112
Date: Thu, 23 May 2019 14:39:19 +0200
878112
Subject: [PATCH 2/2] [doc] Document aliases behavior in case of infinite
878112
 recursion (RhBug:1680488)
878112
878112
https://bugzilla.redhat.com/show_bug.cgi?id=1680488
878112
---
878112
 doc/command_ref.rst | 2 ++
878112
 1 file changed, 2 insertions(+)
878112
878112
diff --git a/doc/command_ref.rst b/doc/command_ref.rst
878112
index ba22453055..ab72b66f8f 100644
878112
--- a/doc/command_ref.rst
878112
+++ b/doc/command_ref.rst
878112
@@ -423,6 +423,8 @@ To use an alias (name=value), the name must be placed as the first "command" (e.
878112
 that is not an option). It is then replaced by its value and the resulting sequence is again searched
878112
 for aliases. The alias processing stops when the first found command is not a name of any alias.
878112
 
878112
+In case the processing would result in an infinite recursion, the original arguments are used instead.
878112
+
878112
 Also, like in shell aliases, if the result starts with a ``\``, the alias processing will stop.
878112
 
878112
 All aliases are defined in configuration files in the ``/etc/dnf/aliases.d/`` directory in the [aliases] section,