]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pakfire/patches/0005-Fix-caching-scriptlets.patch
pakfire: Import latest upstream patches.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0005-Fix-caching-scriptlets.patch
CommitLineData
11d34126
MT
1From bd629777539347ab8da89616d6cd724c44c04f5c Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Tue, 2 Oct 2012 23:11:56 +0200
4Subject: [PATCH 5/6] Fix caching scriptlets.
5
6Fixes #10117.
7
8Scriptlets have not been executed when the package has
9not been available (i.e. had to be downloaded).
10---
11 python/pakfire/actions.py | 13 +++++++++++--
12 1 file changed, 11 insertions(+), 2 deletions(-)
13
14diff --git a/python/pakfire/actions.py b/python/pakfire/actions.py
15index 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--
391.7.11.4
40