diff --git a/needrestart.spec b/needrestart.spec index 22f7645..09662a7 100644 --- a/needrestart.spec +++ b/needrestart.spec @@ -1,6 +1,6 @@ Name: needrestart Version: 2.11 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Restart daemons after library updates License: GPLv2+ @@ -101,6 +101,9 @@ cp %{SOURCE3} %{buildroot}/usr/lib/yum-plugins/needrestart.py %changelog +* Thu Dec 21 2017 Marc Dequènes (Duck) - 2.11-8 +- fix 'check_needed' variable scope in YUM plugin + * Thu Oct 05 2017 Marc Dequènes (Duck) - 2.11-7 - forgot the %%{?dist} release component diff --git a/yum__plugin.py b/yum__plugin.py index 821217a..41d9a99 100644 --- a/yum__plugin.py +++ b/yum__plugin.py @@ -8,11 +8,15 @@ plugin_type = (TYPE_INTERACTIVE) check_needed = False def posttrans_hook(conduit): + global check_needed + check_needed = True # acting in posttrans_hook is too early, we need to be sure the RPMDB is closed to avoid things like: # « Rpmdb changed underneath us » followed by failure to open the database on the next YUM call def close_hook(conduit): + global check_needed + if not check_needed: return try: