From 3129342c46d71a60dd0e71210467fbc10de722fd Mon Sep 17 00:00:00 2001 From: Packit Date: Aug 19 2020 14:20:09 +0000 Subject: Apply patch 0002-Fix-and-document-order-of-config-files-in-aliasesd-RhBug1680489.patch patch_name: 0002-Fix-and-document-order-of-config-files-in-aliasesd-RhBug1680489.patch location_in_specfile: 2 present_in_specfile: true --- diff --git a/dnf/cli/aliases.py b/dnf/cli/aliases.py index 0b3ba8f..b5283d0 100644 --- a/dnf/cli/aliases.py +++ b/dnf/cli/aliases.py @@ -143,7 +143,7 @@ class Aliases(object): try: if not os.path.exists(ALIASES_DROPIN_DIR): os.mkdir(ALIASES_DROPIN_DIR) - for fn in os.listdir(ALIASES_DROPIN_DIR): + for fn in sorted(os.listdir(ALIASES_DROPIN_DIR)): if _ignore_filename(fn): continue filenames.append(os.path.join(ALIASES_DROPIN_DIR, fn)) diff --git a/doc/command_ref.rst b/doc/command_ref.rst index 7141fc2..637ccf9 100644 --- a/doc/command_ref.rst +++ b/doc/command_ref.rst @@ -424,7 +424,10 @@ for aliases. The alias processing stops when the first found command is not a na 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, -and aliases created by the alias command are written to the ``USER.conf`` file. +and aliases created by the alias command are written to the ``USER.conf`` file. In case of conflicts, +the ``USER.conf`` has the highest priority, and alphabetical ordering is used for the rest of the +configuration files. + Optionally, there is the ``enabled`` option in the ``[main]`` section defaulting to True. This can be set for each file separately in the respective file, or globally for all aliases in the ``ALIASES.conf`` file.