From bd629777539347ab8da89616d6cd724c44c04f5c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 2 Oct 2012 23:11:56 +0200 Subject: [PATCH] Fix caching scriptlets. Fixes #10117. Scriptlets have not been executed when the package has not been available (i.e. had to be downloaded). --- python/pakfire/actions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/pakfire/actions.py b/python/pakfire/actions.py index 9fda2613e..b8d0fb3e0 100644 --- a/python/pakfire/actions.py +++ b/python/pakfire/actions.py @@ -140,8 +140,17 @@ class ActionScript(Action): script_action = None def init(self): - # Load the scriplet. - self.scriptlet = self.pkg.get_scriptlet(self.script_action) + self._scriptlet = None + + @property + def scriptlet(self): + """ + Load the scriplet. + """ + if self._scriptlet is None: + self._scriptlet = self.pkg.get_scriptlet(self.script_action) + + return self._scriptlet def get_lang(self): if not self.scriptlet: -- 2.39.5