Blame SOURCES/BZ-1127783-transaction-actions-fix-file-globs.patch

911d2c
diff -up yum-utils-1.1.31/plugins/post-transaction-actions/post-transaction-actions.py.orig yum-utils-1.1.31/plugins/post-transaction-actions/post-transaction-actions.py
911d2c
--- yum-utils-1.1.31/plugins/post-transaction-actions/post-transaction-actions.py.orig	2017-11-03 16:26:49.762703946 +0100
911d2c
+++ yum-utils-1.1.31/plugins/post-transaction-actions/post-transaction-actions.py	2017-11-03 16:26:53.607688349 +0100
911d2c
@@ -139,7 +139,6 @@ def posttrans_hook(conduit):
911d2c
                 c_string = re.compile(restring)
911d2c
 
911d2c
             for txmbr in pkgset:
911d2c
-                matched = False
911d2c
                 thispo = txmbr.po
911d2c
                 if txmbr.output_state in TS_INSTALL_STATES:
911d2c
                     # thispo is AvailablePackage; filelist access could trigger download
911d2c
@@ -150,17 +149,13 @@ def posttrans_hook(conduit):
911d2c
                     if a_k in thispo.filelist + thispo.dirlist + thispo.ghostlist:
911d2c
                         thiscommand = _convert_vars(txmbr, a_c)
911d2c
                         commands_to_run[thiscommand] = 1
911d2c
-                        matched = True
911d2c
+                        break
911d2c
                 else:
911d2c
                     for name in thispo.filelist + thispo.dirlist + thispo.ghostlist:
911d2c
                         if c_string.match(name):
911d2c
                             thiscommand = _convert_vars(txmbr, a_c)
911d2c
                             commands_to_run[thiscommand] = 1
911d2c
-                            matched = True
911d2c
                             break
911d2c
-                
911d2c
-                if matched:
911d2c
-                    break
911d2c
             continue
911d2c
         
911d2c
         if a_k.find('/') == -1: # pkgspec
911d2c
diff -up yum-utils-1.1.31/plugins/post-transaction-actions/sample.action.orig yum-utils-1.1.31/plugins/post-transaction-actions/sample.action
911d2c
--- yum-utils-1.1.31/plugins/post-transaction-actions/sample.action.orig	2011-08-10 17:20:19.000000000 +0200
911d2c
+++ yum-utils-1.1.31/plugins/post-transaction-actions/sample.action	2017-11-03 16:26:53.607688349 +0100
911d2c
@@ -19,3 +19,8 @@ zsh:install:touch /tmp/zsh-installed-als
911d2c
 /bin/z*h:install:touch /tmp/bin-zsh-installed
911d2c
 z*h:any:touch /tmp/bin-zsh-any
911d2c
 
911d2c
+# each action is expanded once for each matching package, and no action is
911d2c
+# executed twice per transaction, for example
911d2c
+*:install:echo $repoid >>/tmp/repos
911d2c
+# will write each repo only once to /tmp/repos, even if multiple packages from
911d2c
+# the same repo were installed
911d2c
diff -up yum-utils-1.1.31/plugins/pre-transaction-actions/pre-transaction-actions.py.orig yum-utils-1.1.31/plugins/pre-transaction-actions/pre-transaction-actions.py
911d2c
--- yum-utils-1.1.31/plugins/pre-transaction-actions/pre-transaction-actions.py.orig	2017-11-03 16:26:49.819703715 +0100
911d2c
+++ yum-utils-1.1.31/plugins/pre-transaction-actions/pre-transaction-actions.py	2017-11-03 16:26:53.609688341 +0100
911d2c
@@ -120,24 +120,19 @@ def pretrans_hook(conduit):
911d2c
                 c_string = re.compile(restring)
911d2c
 
911d2c
             for txmbr in pkgset:
911d2c
-                matched = False
911d2c
                 thispo = txmbr.po
911d2c
         
911d2c
                 if not yum.misc.re_glob(a_k):
911d2c
                     if a_k in thispo.filelist + thispo.dirlist + thispo.ghostlist:
911d2c
                         thiscommand = _convert_vars(txmbr, a_c)
911d2c
                         commands_to_run[thiscommand] = 1
911d2c
-                        matched = True
911d2c
+                        break
911d2c
                 else:
911d2c
                     for name in thispo.filelist + thispo.dirlist + thispo.ghostlist:
911d2c
                         if c_string.match(name):
911d2c
                             thiscommand = _convert_vars(txmbr, a_c)
911d2c
                             commands_to_run[thiscommand] = 1
911d2c
-                            matched = True
911d2c
                             break
911d2c
-                
911d2c
-                if matched:
911d2c
-                    break
911d2c
             continue
911d2c
         
911d2c
         if a_k.find('/') == -1: # pkgspec
911d2c
diff -up yum-utils-1.1.31/plugins/pre-transaction-actions/sample.action.orig yum-utils-1.1.31/plugins/pre-transaction-actions/sample.action
911d2c
--- yum-utils-1.1.31/plugins/pre-transaction-actions/sample.action.orig	2017-11-03 16:26:49.820703711 +0100
911d2c
+++ yum-utils-1.1.31/plugins/pre-transaction-actions/sample.action	2017-11-03 16:26:53.609688341 +0100
911d2c
@@ -19,3 +19,8 @@ zsh:install:touch /tmp/zsh-installed-als
911d2c
 /bin/z*h:install:touch /tmp/bin-zsh-installed
911d2c
 z*h:any:touch /tmp/bin-zsh-any
911d2c
 
911d2c
+# each action is expanded once for each matching package, and no action is
911d2c
+# executed twice per transaction, for example
911d2c
+*:install:echo $repoid >>/tmp/repos
911d2c
+# will write each repo only once to /tmp/repos, even if multiple packages from
911d2c
+# the same repo are going to be installed