From: Michael Tremer Date: Tue, 2 Oct 2012 21:11:56 +0000 (+0200) Subject: Fix caching scriptlets. X-Git-Tag: 0.9.24~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd629777539347ab8da89616d6cd724c44c04f5c;p=pakfire.git Fix caching scriptlets. Fixes #10117. Scriptlets have not been executed when the package has not been available (i.e. had to be downloaded). --- 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: