]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - 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
diff --git a/pakfire/patches/0005-Fix-caching-scriptlets.patch b/pakfire/patches/0005-Fix-caching-scriptlets.patch
new file mode 100644 (file)
index 0000000..3a60306
--- /dev/null
@@ -0,0 +1,40 @@
+From bd629777539347ab8da89616d6cd724c44c04f5c Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Tue, 2 Oct 2012 23:11:56 +0200
+Subject: [PATCH 5/6] 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 9fda261..b8d0fb3 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:
+-- 
+1.7.11.4
+