forked from rpms/dnf-plugins-core
		
	Merge branch 'c9' into a9
This commit is contained in:
		
						commit
						1eef66f813
					
				| @ -0,0 +1,55 @@ | ||||
| From f65bb02d8c6fb6569c3e1db43c3b0e9f2a0ab283 Mon Sep 17 00:00:00 2001 | ||||
| From: Todd Lewis <todd_lewis@unc.edu> | ||||
| Date: Wed, 16 Nov 2022 10:45:39 -0500 | ||||
| Subject: [PATCH] Fix boot time derivation for systems with no rtc | ||||
| 
 | ||||
| That addresses https://bugzilla.redhat.com/show_bug.cgi?id=2137935 | ||||
| ---
 | ||||
|  plugins/needs_restarting.py | 24 +++++++++++++++++++++++- | ||||
|  1 file changed, 23 insertions(+), 1 deletion(-) | ||||
| 
 | ||||
| diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
 | ||||
| index 91dbe66..03831fa 100644
 | ||||
| --- a/plugins/needs_restarting.py
 | ||||
| +++ b/plugins/needs_restarting.py
 | ||||
| @@ -34,6 +34,7 @@ import functools
 | ||||
|  import os | ||||
|  import re | ||||
|  import stat | ||||
| +import time
 | ||||
|   | ||||
|   | ||||
|  # For which package updates we should recommend a reboot | ||||
| @@ -199,7 +200,28 @@ class ProcessStart(object):
 | ||||
|   | ||||
|      @staticmethod | ||||
|      def get_boot_time(): | ||||
| -        return int(os.stat('/proc/1').st_mtime)
 | ||||
| +        """
 | ||||
| +        We have two sources from which to derive the boot time. These values vary
 | ||||
| +        depending on containerization, existence of a Real Time Clock, etc.
 | ||||
| +        For our purposes we want the latest derived value.
 | ||||
| +        - st_mtime of /proc/1
 | ||||
| +             Reflects the time the first process was run after booting
 | ||||
| +             This works for all known cases except machines without
 | ||||
| +             a RTC - they awake at the start of the epoch.
 | ||||
| +        - /proc/uptime
 | ||||
| +             Seconds field of /proc/uptime subtracted from the current time
 | ||||
| +             Works for machines without RTC iff the current time is reasonably correct.
 | ||||
| +             Does not work on containers which share their kernel with the
 | ||||
| +             host - there the host kernel uptime is returned
 | ||||
| +        """
 | ||||
| +
 | ||||
| +        proc_1_boot_time = int(os.stat('/proc/1').st_mtime)
 | ||||
| +        if os.path.isfile('/proc/uptime'):
 | ||||
| +            with open('/proc/uptime', 'rb') as f:
 | ||||
| +                uptime = f.readline().strip().split()[0].strip()
 | ||||
| +                proc_uptime_boot_time = int(time.time() - float(uptime))
 | ||||
| +                return max(proc_1_boot_time, proc_uptime_boot_time)
 | ||||
| +        return proc_1_boot_time
 | ||||
|   | ||||
|      @staticmethod | ||||
|      def get_sc_clk_tck(): | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
| @ -0,0 +1,241 @@ | ||||
| From d5f5883623ada37b4cec5909a1032c4bc3123a9a Mon Sep 17 00:00:00 2001 | ||||
| From: Cameron Rodriguez <rod.cam2014+dev@gmail.com> | ||||
| Date: Tue, 1 Nov 2022 02:25:52 -0400 | ||||
| Subject: [PATCH] [system-upgrade] Add --poweroff option to reboot subcommand | ||||
| 
 | ||||
| = changelog =
 | ||||
| msg: Add --poweroff option to system-upgrade reboot | ||||
| type: enhancement | ||||
| ---
 | ||||
|  doc/system-upgrade.rst       | 10 ++++++++++ | ||||
|  plugins/system_upgrade.py    | 28 ++++++++++++++++++++++------ | ||||
|  tests/test_system_upgrade.py | 18 +++++++++++++++++- | ||||
|  3 files changed, 49 insertions(+), 7 deletions(-) | ||||
| 
 | ||||
| diff --git a/doc/system-upgrade.rst b/doc/system-upgrade.rst
 | ||||
| index 87b7319..6a7785b 100644
 | ||||
| --- a/doc/system-upgrade.rst
 | ||||
| +++ b/doc/system-upgrade.rst
 | ||||
| @@ -44,6 +44,8 @@ Synopsis
 | ||||
|   | ||||
|  ``dnf system-upgrade reboot`` | ||||
|   | ||||
| +``dnf system-upgrade reboot --poweroff``
 | ||||
| +
 | ||||
|  ``dnf system-upgrade clean`` | ||||
|   | ||||
|  ``dnf system-upgrade log`` | ||||
| @@ -54,6 +56,8 @@ Synopsis
 | ||||
|   | ||||
|  ``dnf offline-upgrade reboot`` | ||||
|   | ||||
| +``dnf offline-upgrade reboot --poweroff``
 | ||||
| +
 | ||||
|  ``dnf offline-upgrade clean`` | ||||
|   | ||||
|  ``dnf offline-upgrade log`` | ||||
| @@ -64,6 +68,8 @@ Synopsis
 | ||||
|   | ||||
|  ``dnf offline-distrosync reboot`` | ||||
|   | ||||
| +``dnf offline-distrosync reboot --poweroff``
 | ||||
| +
 | ||||
|  ``dnf offline-distrosync clean`` | ||||
|   | ||||
|  ``dnf offline-distrosync log`` | ||||
| @@ -116,6 +122,10 @@ Options
 | ||||
|      ``--distro-sync``. If both are specified, the last option will be used. The option cannot be | ||||
|      used with the ``offline-distrosync`` command. | ||||
|   | ||||
| +``--poweroff``
 | ||||
| +    When applied with the ``reboot`` subcommand, the system will power off after
 | ||||
| +    upgrades are completed, instead of restarting.
 | ||||
| +
 | ||||
|  ``--number`` | ||||
|      Applied with ``log`` subcommand will show the log specified by the number. | ||||
|   | ||||
| diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
 | ||||
| index 4f7620f..b99dd8a 100644
 | ||||
| --- a/plugins/system_upgrade.py
 | ||||
| +++ b/plugins/system_upgrade.py
 | ||||
| @@ -61,16 +61,19 @@ DOWNLOAD_FINISHED_MSG = _(  # Translators: do not change "reboot" here
 | ||||
|  CANT_RESET_RELEASEVER = _( | ||||
|      "Sorry, you need to use 'download --releasever' instead of '--network'") | ||||
|   | ||||
| -STATE_VERSION = 2
 | ||||
| +STATE_VERSION = 3
 | ||||
|   | ||||
|  # --- Miscellaneous helper functions ------------------------------------------ | ||||
|   | ||||
|   | ||||
| -def reboot():
 | ||||
| +def reboot(poweroff = False):
 | ||||
|      if os.getenv("DNF_SYSTEM_UPGRADE_NO_REBOOT", default=False): | ||||
|          logger.info(_("Reboot turned off, not rebooting.")) | ||||
|      else: | ||||
| -        Popen(["systemctl", "reboot"])
 | ||||
| +        if poweroff:
 | ||||
| +            Popen(["systemctl", "poweroff"])
 | ||||
| +        else:
 | ||||
| +            Popen(["systemctl", "reboot"])
 | ||||
|   | ||||
|   | ||||
|  def get_url_from_os_release(): | ||||
| @@ -183,6 +186,7 @@ class State(object):
 | ||||
|      upgrade_status = _prop("upgrade_status") | ||||
|      upgrade_command = _prop("upgrade_command") | ||||
|      distro_sync = _prop("distro_sync") | ||||
| +    poweroff_after = _prop("poweroff_after")
 | ||||
|      enable_disable_repos = _prop("enable_disable_repos") | ||||
|      module_platform_id = _prop("module_platform_id") | ||||
|   | ||||
| @@ -359,6 +363,10 @@ class SystemUpgradeCommand(dnf.cli.Command):
 | ||||
|                              action='store_false', | ||||
|                              help=_("keep installed packages if the new " | ||||
|                                     "release's version is older")) | ||||
| +        parser.add_argument('--poweroff', dest='poweroff_after',
 | ||||
| +                            action='store_true',
 | ||||
| +                            help=_("power off system after the operation "
 | ||||
| +                                   "is completed"))
 | ||||
|          parser.add_argument('tid', nargs=1, choices=CMDS, | ||||
|                              metavar="[%s]" % "|".join(CMDS)) | ||||
|          parser.add_argument('--number', type=int, help=_('which logs to show')) | ||||
| @@ -566,8 +574,13 @@ class SystemUpgradeCommand(dnf.cli.Command):
 | ||||
|          if not self.opts.tid[0] == "reboot": | ||||
|              return | ||||
|   | ||||
| +        self.state.poweroff_after = self.opts.poweroff_after
 | ||||
| +
 | ||||
|          self.log_status(_("Rebooting to perform upgrade."), | ||||
|                          REBOOT_REQUESTED_ID) | ||||
| +
 | ||||
| +        # Explicit write since __exit__ doesn't seem to get called when rebooting
 | ||||
| +        self.state.write()
 | ||||
|          reboot() | ||||
|   | ||||
|      def run_download(self): | ||||
| @@ -686,12 +699,15 @@ class SystemUpgradeCommand(dnf.cli.Command):
 | ||||
|          self.log_status(_("Download finished."), DOWNLOAD_FINISHED_ID) | ||||
|   | ||||
|      def transaction_upgrade(self): | ||||
| -        Plymouth.message(_("Upgrade complete! Cleaning up and rebooting..."))
 | ||||
| -        self.log_status(_("Upgrade complete! Cleaning up and rebooting..."),
 | ||||
| +        power_op = "powering off" if self.state.poweroff_after else "rebooting"
 | ||||
| +
 | ||||
| +        Plymouth.message(_("Upgrade complete! Cleaning up and " + power_op + "..."))
 | ||||
| +        self.log_status(_("Upgrade complete! Cleaning up and " + power_op + "..."),
 | ||||
|                          UPGRADE_FINISHED_ID) | ||||
| +
 | ||||
|          self.run_clean() | ||||
|          if self.opts.tid[0] == "upgrade": | ||||
| -            reboot()
 | ||||
| +            reboot(self.state.poweroff_after)
 | ||||
|   | ||||
|   | ||||
|  class OfflineUpgradeCommand(SystemUpgradeCommand): | ||||
| diff --git a/tests/test_system_upgrade.py b/tests/test_system_upgrade.py
 | ||||
| index 6ef4c21..769720d 100644
 | ||||
| --- a/tests/test_system_upgrade.py
 | ||||
| +++ b/tests/test_system_upgrade.py
 | ||||
| @@ -322,7 +322,7 @@ class RebootCheckCommandTestCase(CommandTestCaseBase):
 | ||||
|      def check_reboot(self, status='complete', lexists=False, command='system-upgrade', | ||||
|                       state_command='system-upgrade'): | ||||
|          with patch('system_upgrade.os.path.lexists') as lexists_func: | ||||
| -            self.command.state.state_version = 2
 | ||||
| +            self.command.state.state_version = 3
 | ||||
|              self.command.state.download_status = status | ||||
|              self.command.opts = mock.MagicMock() | ||||
|              self.command.opts.command = command | ||||
| @@ -356,6 +356,7 @@ class RebootCheckCommandTestCase(CommandTestCaseBase):
 | ||||
|      @patch('system_upgrade.reboot') | ||||
|      def test_run_reboot(self, reboot, log_status, run_prepare): | ||||
|          self.command.opts = mock.MagicMock() | ||||
| +        self.command.opts.poweroff_after = False
 | ||||
|          self.command.opts.tid = ["reboot"] | ||||
|          self.command.run_reboot() | ||||
|          run_prepare.assert_called_once_with() | ||||
| @@ -363,6 +364,21 @@ class RebootCheckCommandTestCase(CommandTestCaseBase):
 | ||||
|                           log_status.call_args[0][1]) | ||||
|          self.assertTrue(reboot.called) | ||||
|   | ||||
| +    @patch('system_upgrade.SystemUpgradeCommand.run_prepare')
 | ||||
| +    @patch('system_upgrade.SystemUpgradeCommand.log_status')
 | ||||
| +    @patch('system_upgrade.reboot')
 | ||||
| +    def test_reboot_poweroff_after(self, reboot, log_status, run_prepare):
 | ||||
| +        self.command.opts = mock.MagicMock()
 | ||||
| +        self.command.opts.tid = ["reboot"]
 | ||||
| +        self.command.opts.poweroff_after = True
 | ||||
| +        self.command.run_reboot()
 | ||||
| +        run_prepare.assert_called_with()
 | ||||
| +        self.assertEqual(system_upgrade.REBOOT_REQUESTED_ID,
 | ||||
| +                         log_status.call_args[0][1])
 | ||||
| +        self.assertTrue(self.command.state.poweroff_after)
 | ||||
| +        self.assertTrue(reboot.called)
 | ||||
| +
 | ||||
| +
 | ||||
|      @patch('system_upgrade.SystemUpgradeCommand.run_prepare') | ||||
|      @patch('system_upgrade.SystemUpgradeCommand.log_status') | ||||
|      @patch('system_upgrade.reboot') | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
| 
 | ||||
| From 52aec32ef129874dc28fc93947e5d32c78baff0c Mon Sep 17 00:00:00 2001 | ||||
| From: Cameron Rodriguez <rod.cam2014+dev@gmail.com> | ||||
| Date: Tue, 1 Nov 2022 02:29:29 -0400 | ||||
| Subject: [PATCH] Add Cameron Rodriguez to AUTHORS file | ||||
| 
 | ||||
| ---
 | ||||
|  AUTHORS | 1 + | ||||
|  1 file changed, 1 insertion(+) | ||||
| 
 | ||||
| diff --git a/AUTHORS b/AUTHORS
 | ||||
| index f098cb6..a6102ec 100644
 | ||||
| --- a/AUTHORS
 | ||||
| +++ b/AUTHORS
 | ||||
| @@ -20,6 +20,7 @@ DNF-PLUGINS-CORE CONTRIBUTORS
 | ||||
|      Adam Salih <salih.max@gmail.com> | ||||
|      Alexander Todorov <atodorov@otb.bg> | ||||
|      Anders Blomdell <anders.blomdell@gmail.com> | ||||
| +    Cameron Rodriguez <rod.cam2014+dev@gmail.com>
 | ||||
|      Cyril Jouve <jv.cyril@gmail.com> | ||||
|      David Michael <fedora.dm0@gmail.com> | ||||
|      François Rigault <francois.rigault@amadeus.com> | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
| 
 | ||||
| From dd081ebd4c46a79688f81ef639628189f8b78db3 Mon Sep 17 00:00:00 2001 | ||||
| From: Cameron Rodriguez <rod.cam2014+dev@gmail.com> | ||||
| Date: Sun, 4 Dec 2022 10:06:08 -0500 | ||||
| Subject: [PATCH] [offline-upgrade] Fix strings for l10n | ||||
| 
 | ||||
| ---
 | ||||
|  plugins/system_upgrade.py | 10 ++++++---- | ||||
|  1 file changed, 6 insertions(+), 4 deletions(-) | ||||
| 
 | ||||
| diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
 | ||||
| index b99dd8a..64195fd 100644
 | ||||
| --- a/plugins/system_upgrade.py
 | ||||
| +++ b/plugins/system_upgrade.py
 | ||||
| @@ -699,11 +699,13 @@ class SystemUpgradeCommand(dnf.cli.Command):
 | ||||
|          self.log_status(_("Download finished."), DOWNLOAD_FINISHED_ID) | ||||
|   | ||||
|      def transaction_upgrade(self): | ||||
| -        power_op = "powering off" if self.state.poweroff_after else "rebooting"
 | ||||
| +        if self.state.poweroff_after:
 | ||||
| +            upgrade_complete_msg = _("Upgrade complete! Cleaning up and powering off...")
 | ||||
| +        else:
 | ||||
| +            upgrade_complete_msg = _("Upgrade complete! Cleaning up and rebooting...")
 | ||||
|   | ||||
| -        Plymouth.message(_("Upgrade complete! Cleaning up and " + power_op + "..."))
 | ||||
| -        self.log_status(_("Upgrade complete! Cleaning up and " + power_op + "..."),
 | ||||
| -                        UPGRADE_FINISHED_ID)
 | ||||
| +        Plymouth.message(upgrade_complete_msg)
 | ||||
| +        self.log_status(upgrade_complete_msg, UPGRADE_FINISHED_ID)
 | ||||
|   | ||||
|          self.run_clean() | ||||
|          if self.opts.tid[0] == "upgrade": | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
| @ -0,0 +1,34 @@ | ||||
| From 52c980f191993b61a42438a478d1e5629ea36c9f Mon Sep 17 00:00:00 2001 | ||||
| From: Jaroslav Mracek <jmracek@redhat.com> | ||||
| Date: Mon, 27 Mar 2023 10:24:59 +0200 | ||||
| Subject: [PATCH] Documentation update for reposync (RhBug:2132383,2182004) | ||||
| 
 | ||||
| The update describe the behavior when `-n` and `--download-metadata` | ||||
| is used. | ||||
| 
 | ||||
| https://bugzilla.redhat.com/show_bug.cgi?id=2132383 | ||||
| https://bugzilla.redhat.com/show_bug.cgi?id=2182004 | ||||
| ---
 | ||||
|  doc/reposync.rst | 6 +++++- | ||||
|  1 file changed, 5 insertions(+), 1 deletion(-) | ||||
| 
 | ||||
| diff --git a/doc/reposync.rst b/doc/reposync.rst
 | ||||
| index 0df00b9..bbf714c 100644
 | ||||
| --- a/doc/reposync.rst
 | ||||
| +++ b/doc/reposync.rst
 | ||||
| @@ -46,7 +46,11 @@ All general DNF options are accepted. Namely, the ``--repoid`` option can be use
 | ||||
|      Delete local packages no longer present in repository. | ||||
|   | ||||
|  ``--download-metadata`` | ||||
| -    Download all repository metadata. Downloaded copy is instantly usable as a repository, no need to run createrepo_c on it.
 | ||||
| +    Download all repository metadata. Downloaded copy is instantly usable as a repository, no need to run createrepo_c
 | ||||
| +    on it. When the option is used with `--newest-only`, only latest packages will be downloaded, but metadata will
 | ||||
| +    still contain older packages. It might be useful to update metadata using `createrepo_c --update` to remove
 | ||||
| +    the packages with missing RPM files from metadata. Otherwise, DNF ends with an error due to the missing files
 | ||||
| +    whenever it tries to download older packages.
 | ||||
|   | ||||
|  ``-g, --gpgcheck`` | ||||
|      Remove packages that fail GPG signature checking after downloading. Exit code is ``1`` if at least one package was removed. | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
| @ -0,0 +1,88 @@ | ||||
| From 169a79922d7cb8968ffd378b1c98959185ee417f Mon Sep 17 00:00:00 2001 | ||||
| From: Andy Baugh <andy@troglodyne.net> | ||||
| Date: Fri, 28 Apr 2023 10:52:16 -0500 | ||||
| Subject: [PATCH] Add fix and test assertion for "no systemd unit exists for | ||||
|  pid" | ||||
| 
 | ||||
| = changelog =
 | ||||
| msg: Catch exception in needs-restarting.py when no systemd unit exists for pid | ||||
| type: bugfix | ||||
| resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2122587 | ||||
| related: None | ||||
| ---
 | ||||
|  plugins/needs_restarting.py    | 18 ++++++++++++++---- | ||||
|  tests/test_needs_restarting.py | 15 +++++++++++++-- | ||||
|  2 files changed, 27 insertions(+), 6 deletions(-) | ||||
| 
 | ||||
| diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
 | ||||
| index 03831fa..8dbc965 100644
 | ||||
| --- a/plugins/needs_restarting.py
 | ||||
| +++ b/plugins/needs_restarting.py
 | ||||
| @@ -138,10 +138,20 @@ def get_service_dbus(pid):
 | ||||
|          systemd_manager_object, | ||||
|          'org.freedesktop.systemd1.Manager' | ||||
|      ) | ||||
| -    service_proxy = bus.get_object(
 | ||||
| -        'org.freedesktop.systemd1',
 | ||||
| -        systemd_manager_interface.GetUnitByPID(pid)
 | ||||
| -    )
 | ||||
| +    service_proxy = None
 | ||||
| +    try:
 | ||||
| +        service_proxy = bus.get_object(
 | ||||
| +            'org.freedesktop.systemd1',
 | ||||
| +            systemd_manager_interface.GetUnitByPID(pid)
 | ||||
| +        )
 | ||||
| +    except dbus.DBusException as e:
 | ||||
| +        # There is no unit for the pid. Usually error is 'NoUnitForPid'.
 | ||||
| +        # Considering what we do at the bottom (just return if not service)
 | ||||
| +        # Then there's really no reason to exit here on that exception.
 | ||||
| +        # Log what's happened then move on.
 | ||||
| +        msg = str(e)
 | ||||
| +        logger.warning("Failed to get systemd unit for PID {}: {}".format(pid, msg))
 | ||||
| +        return
 | ||||
|      service_properties = dbus.Interface( | ||||
|          service_proxy, dbus_interface="org.freedesktop.DBus.Properties") | ||||
|      name = service_properties.Get( | ||||
| diff --git a/tests/test_needs_restarting.py b/tests/test_needs_restarting.py
 | ||||
| index 0ad70a5..7b629b4 100644
 | ||||
| --- a/tests/test_needs_restarting.py
 | ||||
| +++ b/tests/test_needs_restarting.py
 | ||||
| @@ -20,6 +20,8 @@ from __future__ import absolute_import
 | ||||
|  from __future__ import print_function | ||||
|  from __future__ import unicode_literals | ||||
|   | ||||
| +from unittest.mock import patch, Mock
 | ||||
| +import dbus
 | ||||
|  import needs_restarting | ||||
|  import tests.support | ||||
|   | ||||
| @@ -29,8 +31,6 @@ MM_FILE = '7fc4e1168000-7fc4e1169000 rw-s 1096dd000 00:05 7749' \
 | ||||
|            '                      /dev/dri/card0' | ||||
|  SO_FILE = '30efe06000-30efe07000 r--p 00006000 08:02 139936' \ | ||||
|            '                         /usr/lib64/libSM.so.6.0.1' | ||||
| -
 | ||||
| -
 | ||||
|  class NeedsRestartingTest(tests.support.TestCase): | ||||
|      def test_smap2opened_file(self): | ||||
|          func = needs_restarting.smap2opened_file | ||||
| @@ -46,6 +46,17 @@ class NeedsRestartingTest(tests.support.TestCase):
 | ||||
|          self.assertTrue(ofile.deleted) | ||||
|          self.assertEqual(ofile.name, '/usr/lib64/libXfont.so.1.4.1;5408628d') | ||||
|   | ||||
| +    def test_get_service_dbus_nounitforpid(self):
 | ||||
| +        func = needs_restarting.get_service_dbus
 | ||||
| +        # So, This is gonna look kinda screwy unless you are aware of what
 | ||||
| +        # this proxies interface is actually doing. The GetUnitByPid function
 | ||||
| +        # is normally "dynamically" defined by the get_dbus_method at runtime.
 | ||||
| +        # As such there's no actual way to mock it out in any meaningful way
 | ||||
| +        # without create=True.
 | ||||
| +        with patch( "dbus.proxies.Interface.GetUnitByPID", create=True, side_effect=dbus.DBusException('org.freedesktop.systemd1.NoUnitForPID: PID 1234 does not belong to any loaded unit.') ), \
 | ||||
| +             patch( "dbus.SystemBus", return_value=Mock(spec=dbus.Bus) ), \
 | ||||
| +             patch( "dbus.bus.BusConnection.__new__", side_effect=dbus.DBusException("Never should hit this exception if mock above works")):
 | ||||
| +                 self.assertIsNone(func(1234))
 | ||||
|   | ||||
|  class OpenedFileTest(tests.support.TestCase): | ||||
|      def test_presumed_name(self): | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
| @ -0,0 +1,32 @@ | ||||
| From 7475f8df6d903764eaf8baaa87ec7a3a1a4d888c Mon Sep 17 00:00:00 2001 | ||||
| From: Jan Kolarik <jkolarik@redhat.com> | ||||
| Date: Fri, 9 Jun 2023 11:57:33 +0000 | ||||
| Subject: [PATCH] system-upgrade: Wait until the upgrade is done before | ||||
|  poweroff (RhBug:2211844) | ||||
| 
 | ||||
| Add a systemd dependency to wait until upgrade service is finished before executing the poweroff when passing the `--poweroff` option in `system-upgrade` plugin. | ||||
| 
 | ||||
| = changelog =
 | ||||
| msg: Fix systemd dependencies when using --poweroff option in system-upgrade plugin | ||||
| type: bugfix | ||||
| resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2211844 | ||||
| ---
 | ||||
|  etc/systemd/dnf-system-upgrade.service | 2 +- | ||||
|  1 file changed, 1 insertion(+), 1 deletion(-) | ||||
| 
 | ||||
| diff --git a/etc/systemd/dnf-system-upgrade.service b/etc/systemd/dnf-system-upgrade.service
 | ||||
| index 2d23cfe..3e15920 100644
 | ||||
| --- a/etc/systemd/dnf-system-upgrade.service
 | ||||
| +++ b/etc/systemd/dnf-system-upgrade.service
 | ||||
| @@ -6,7 +6,7 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates
 | ||||
|  DefaultDependencies=no | ||||
|  Requires=sysinit.target | ||||
|  After=sysinit.target systemd-journald.socket system-update-pre.target | ||||
| -Before=shutdown.target system-update.target
 | ||||
| +Before=poweroff.target reboot.target shutdown.target system-update.target
 | ||||
|  OnFailure=dnf-system-upgrade-cleanup.service | ||||
|   | ||||
|  [Service] | ||||
| -- 
 | ||||
| 2.40.1 | ||||
| 
 | ||||
							
								
								
									
										3214
									
								
								SOURCES/0011-Update-translations-RHEL-9.3.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3214
									
								
								SOURCES/0011-Update-translations-RHEL-9.3.patch
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -34,7 +34,7 @@ | ||||
| 
 | ||||
| Name:           dnf-plugins-core | ||||
| Version:        4.3.0 | ||||
| Release:        5%{?dist}.alma.1 | ||||
| Release:        11%{?dist}.alma.1 | ||||
| Summary:        Core Plugins for DNF | ||||
| License:        GPLv2+ | ||||
| URL:            https://github.com/rpm-software-management/dnf-plugins-core | ||||
| @ -44,8 +44,13 @@ Patch2:         0002-Add-a-warning-when-using-system-upgrade-on-RHEL.patch | ||||
| Patch3:         0003-offline-upgrade-Add-security-filters.patch | ||||
| Patch4:         0004-system-upgrade-Show-warning-always-for-a-downstream.patch | ||||
| Patch5:         0005-Update-translations.patch | ||||
| Patch6:         0006-Fix-issue-with-invalid-utf8.patch | ||||
| 
 | ||||
| Patch6:         0006-Fix-boot-time-derivation-for-systems-with-no-rtc.patch | ||||
| Patch7:         0007-system-upgrade-Add-poweroff-option-to-reboot-subcomm.patch | ||||
| Patch8:         0008-Doc-update-for-reposync-RhBug-2132383-2182004.patch | ||||
| Patch9:         0009-Add-fix-and-test-assertion-for-no-systemd-unit-exist.patch | ||||
| Patch10:        0010-sys-upgrade_Wait_until_upgrade_done_before_poweoff.patch | ||||
| Patch11:        0011-Update-translations-RHEL-9.3.patch | ||||
| Patch12:        0012-Fix-issue-with-invalid-utf8.patch | ||||
| 
 | ||||
| BuildArch:      noarch | ||||
| BuildRequires:  cmake | ||||
| @ -220,7 +225,7 @@ repoquery, reposync, repotrack, repodiff, builddep, config-manager, debug, | ||||
| download and yum-groups-manager that use new implementations using DNF. | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 && %{with python2} | ||||
| %if %{with python2} | ||||
| %package -n python2-dnf-plugin-leaves | ||||
| Summary:        Leaves Plugin for DNF | ||||
| Requires:       python2-%{name} = %{version}-%{release} | ||||
| @ -239,7 +244,7 @@ Leaves Plugin for DNF, Python 2 version. List all installed packages | ||||
| not required by any other installed package. | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 && %{with python3} | ||||
| %if %{with python3} | ||||
| %package -n python3-dnf-plugin-leaves | ||||
| Summary:        Leaves Plugin for DNF | ||||
| Requires:       python3-%{name} = %{version}-%{release} | ||||
| @ -337,7 +342,7 @@ Post transaction actions Plugin for DNF, Python 3 version. Plugin runs actions | ||||
| files. | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 && %{with python2} | ||||
| %if %{with python2} | ||||
| %package -n python2-dnf-plugin-show-leaves | ||||
| Summary:        Leaves Plugin for DNF | ||||
| Requires:       python2-%{name} = %{version}-%{release} | ||||
| @ -358,7 +363,7 @@ packages that are no longer required by any other installed package | ||||
| after a transaction. | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 && %{with python3} | ||||
| %if %{with python3} | ||||
| %package -n python3-dnf-plugin-show-leaves | ||||
| Summary:        Show-leaves Plugin for DNF | ||||
| Requires:       python3-%{name} = %{version}-%{release} | ||||
| @ -688,8 +693,6 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/ | ||||
| %exclude %{_mandir}/man1/yum-utils.* | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %files -n python2-dnf-plugin-leaves | ||||
| %{python2_sitelib}/dnf-plugins/leaves.* | ||||
| @ -703,18 +706,6 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/ | ||||
| %{_mandir}/man8/dnf-leaves.* | ||||
| %endif | ||||
| 
 | ||||
| %else | ||||
| %exclude %{_mandir}/man8/dnf-leaves.* | ||||
| %if %{with python2} | ||||
| %exclude %{python2_sitelib}/dnf-plugins/leaves.* | ||||
| %endif | ||||
| %if %{with python3} | ||||
| %exclude %{python3_sitelib}/dnf-plugins/leaves.* | ||||
| %exclude %{python3_sitelib}/dnf-plugins/__pycache__/leaves.* | ||||
| %endif | ||||
| %endif | ||||
| # endif 0%%{?rhel} == 0 | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 && %{with python2} | ||||
| %files -n python2-dnf-plugin-local | ||||
| %config(noreplace) %{_sysconfdir}/dnf/plugins/local.conf | ||||
| @ -755,8 +746,6 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/ | ||||
| %{_mandir}/man8/dnf-post-transaction-actions.* | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} == 0 | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %files -n python2-dnf-plugin-show-leaves | ||||
| %{python2_sitelib}/dnf-plugins/show_leaves.* | ||||
| @ -770,18 +759,6 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/ | ||||
| %{_mandir}/man8/dnf-show-leaves.* | ||||
| %endif | ||||
| 
 | ||||
| %else | ||||
| %exclude %{_mandir}/man8/dnf-show-leaves.* | ||||
| %if %{with python2} | ||||
| %exclude %{python2_sitelib}/dnf-plugins/show_leaves.* | ||||
| %endif | ||||
| %if %{with python3} | ||||
| %exclude %{python3_sitelib}/dnf-plugins/show_leaves.* | ||||
| %exclude %{python3_sitelib}/dnf-plugins/__pycache__/show_leaves.* | ||||
| %endif | ||||
| %endif | ||||
| # endif 0%%{?rhel} == 0 | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %files -n python2-dnf-plugin-versionlock | ||||
| %config(noreplace) %{_sysconfdir}/dnf/plugins/versionlock.conf | ||||
| @ -821,9 +798,31 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/ | ||||
| %endif | ||||
| 
 | ||||
| %changelog | ||||
| * Mon Aug 14 2023 Jonathan Wright <jonathan@almalinux.org> - 4.3.0-5.alma.1 | ||||
| * Mon Dec 14 2023 Jonathan Wright <jonathan@almalinux.org> - 4.3.0-11.alma.1 | ||||
| - Resolves rhbz#2231923 - Smaps file parsing in DNF's needs-restarting cannot handle garbage UTF-8-ish characters in smaps lines | ||||
| 
 | ||||
| * Fri Sep 08 2023 Marek Blaha <mblaha@redhat.com> - 4.3.0-11 | ||||
| - Rebuild in correct target | ||||
| 
 | ||||
| * Thu Sep 07 2023 Marek Blaha <mblaha@redhat.com> - 4.3.0-10 | ||||
| - Update translations RHEL 9.3 | ||||
| 
 | ||||
| * Mon Jun 26 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.3.0-9 | ||||
| - system-upgrade: Wait until the upgrade is done before poweroff (RhBug:2214510) | ||||
| 
 | ||||
| * Wed May 31 2023 Nicola Sella <nsella@redhat.com> - 4.3.0-8 | ||||
| - Add fix and test assertion for "no systemd unit exists for pid" | ||||
| 
 | ||||
| * Wed May 17 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.3.0-7 | ||||
| - Remove patch: "reposync: Implement --safe-write-path option (RhBug:1898089,2203766)" (RhBug:2207946) | ||||
| 
 | ||||
| * Mon May 15 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.3.0-6 | ||||
| - Fix boot time derivation for systems with no rtc (RhBug:2166444,2182157) | ||||
| - system-upgrade: Add --poweroff option to reboot subcommand (RhBug:2157844) | ||||
| - Doc update for reposync (RhBug:2132383,2182004) | ||||
| - reposync: Implement --safe-write-path option (RhBug:1898089,2203766) | ||||
| - Enable the leaves and show-leaves DNF plugins (RhBug:2134638) | ||||
| 
 | ||||
| * Wed Mar 15 2023 Marek Blaha <mblaha@redhat.com> - 4.3.0-5 | ||||
| - Update translations | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user