richardphibel / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone
Blob Blame History Raw
From f89ac56ef0ee7a349e0389913a510ba194022e95 Mon Sep 17 00:00:00 2001
From: Pavla Kratochvilova <pkratoch@redhat.com>
Date: Thu, 23 May 2019 14:32:32 +0200
Subject: [PATCH 1/2] Print the whole alias definition in case of infinite
 recursion (RhBug:1680488)

https://bugzilla.redhat.com/show_bug.cgi?id=1680488
---
 dnf/cli/commands/alias.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dnf/cli/commands/alias.py b/dnf/cli/commands/alias.py
index 10f58867ca..d3e6e4326e 100644
--- a/dnf/cli/commands/alias.py
+++ b/dnf/cli/commands/alias.py
@@ -151,7 +151,8 @@ def list_alias(self, cmd):
         try:
             args = self.aliases_base._resolve(args)
         except dnf.exceptions.Error as e:
-            logger.error(_('%s, alias %s'), e, cmd)
+            logger.error(
+                _('%s, alias %s="%s"'), e, cmd, (' ').join(self.aliases_base.aliases[cmd]))
         else:
             print(_("Alias %s='%s'") % (cmd, " ".join(args)))
 

From ccd4213da366d49f6f84847fa2ccdb890d257930 Mon Sep 17 00:00:00 2001
From: Pavla Kratochvilova <pkratoch@redhat.com>
Date: Thu, 23 May 2019 14:39:19 +0200
Subject: [PATCH 2/2] [doc] Document aliases behavior in case of infinite
 recursion (RhBug:1680488)

https://bugzilla.redhat.com/show_bug.cgi?id=1680488
---
 doc/command_ref.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/command_ref.rst b/doc/command_ref.rst
index ba22453055..ab72b66f8f 100644
--- a/doc/command_ref.rst
+++ b/doc/command_ref.rst
@@ -423,6 +423,8 @@ To use an alias (name=value), the name must be placed as the first "command" (e.
 that is not an option). It is then replaced by its value and the resulting sequence is again searched
 for aliases. The alias processing stops when the first found command is not a name of any alias.
 
+In case the processing would result in an infinite recursion, the original arguments are used instead.
+
 Also, like in shell aliases, if the result starts with a ``\``, the alias processing will stop.
 
 All aliases are defined in configuration files in the ``/etc/dnf/aliases.d/`` directory in the [aliases] section,