]>
Commit | Line | Data |
---|---|---|
11d34126 MT |
1 | From bd629777539347ab8da89616d6cd724c44c04f5c Mon Sep 17 00:00:00 2001 |
2 | From: Michael Tremer <michael.tremer@ipfire.org> | |
3 | Date: Tue, 2 Oct 2012 23:11:56 +0200 | |
4 | Subject: [PATCH 5/6] Fix caching scriptlets. | |
5 | ||
6 | Fixes #10117. | |
7 | ||
8 | Scriptlets have not been executed when the package has | |
9 | not been available (i.e. had to be downloaded). | |
10 | --- | |
11 | python/pakfire/actions.py | 13 +++++++++++-- | |
12 | 1 file changed, 11 insertions(+), 2 deletions(-) | |
13 | ||
14 | diff --git a/python/pakfire/actions.py b/python/pakfire/actions.py | |
15 | index 9fda261..b8d0fb3 100644 | |
16 | --- a/python/pakfire/actions.py | |
17 | +++ b/python/pakfire/actions.py | |
18 | @@ -140,8 +140,17 @@ class ActionScript(Action): | |
19 | script_action = None | |
20 | ||
21 | def init(self): | |
22 | - # Load the scriplet. | |
23 | - self.scriptlet = self.pkg.get_scriptlet(self.script_action) | |
24 | + self._scriptlet = None | |
25 | + | |
26 | + @property | |
27 | + def scriptlet(self): | |
28 | + """ | |
29 | + Load the scriplet. | |
30 | + """ | |
31 | + if self._scriptlet is None: | |
32 | + self._scriptlet = self.pkg.get_scriptlet(self.script_action) | |
33 | + | |
34 | + return self._scriptlet | |
35 | ||
36 | def get_lang(self): | |
37 | if not self.scriptlet: | |
38 | -- | |
39 | 1.7.11.4 | |
40 |