From cf86ca664d049546325cede856b125aee7d4b741 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Wed, 1 Aug 2012 18:48:12 +0200 Subject: [PATCH] [entropy.client.trigger] call environment_update() whenever ENV_DIRS have been touched --- lib/entropy/client/interfaces/trigger.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/entropy/client/interfaces/trigger.py b/lib/entropy/client/interfaces/trigger.py index c11e9229f..11601771e 100644 --- a/lib/entropy/client/interfaces/trigger.py +++ b/lib/entropy/client/interfaces/trigger.py @@ -40,7 +40,7 @@ class Trigger: action_metadata): """ Trigger manager interface constructor. - + @param entropy_client: Entropy Client interface object @type entropy_client: entropy.client.interfaces.client.Client @param action: package handling action, can be "install", "remove", @@ -135,6 +135,12 @@ class Trigger: ldpaths = entropy.tools.collect_linker_paths() if len(cont_dirs) != len(cont_dirs - set(ldpaths)): functions.insert(0, self._trigger_env_update) + elif self._spm is not None: + # check if environment dirs have been touched + spm_class = self._entropy.Spm_class() + env_dirs = spm_class.ENV_DIRS + if len(env_dirs) != len(env_dirs - cont_dirs): + functions.insert(0, self._trigger_env_update) if self._pkgdata['trigger']: functions.append(self._trigger_call_ext_postinstall) @@ -204,6 +210,12 @@ class Trigger: ldpaths = entropy.tools.collect_linker_paths() if len(cont_dirs) != len(cont_dirs - set(ldpaths)): functions.insert(0, self._trigger_env_update) + elif self._spm is not None: + # check if environment dirs have been touched + spm_class = self._entropy.Spm_class() + env_dirs = spm_class.ENV_DIRS + if len(env_dirs) != len(env_dirs - cont_dirs): + functions.insert(0, self._trigger_env_update) if self._pkgdata['trigger']: functions.append(self._trigger_call_ext_postremove)