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

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