Paste number 60582: allow to place the persistent data into a persistent directory (!= tmp)

Paste number 60582: allow to place the persistent data into a persistent directory (!= tmp)
Pasted by: zecke
5 days, 14 hours ago
#oe | Context in IRC logs
Paste contents:
Raw Source | XML | Display As
Index: persist_data.py
===================================================================
--- persist_data.py        (Revision 1067)
+++ persist_data.py        (Arbeitskopie)
@@ -43,9 +43,9 @@
     Why sqlite? It handles all the locking issues for us.
     """
     def __init__(self, d):
-        self.cachedir = bb.data.getVar("CACHE", d, True)
+        self.cachedir = bb.data.getVar("PERSISTENT_DIR", d, True) or bb.data.getVar("CACHE", d, True)
         if self.cachedir in [None, '']:
-            bb.msg.fatal(bb.msg.domain.PersistData, "Please set the 'CACHE' variable.")
+            bb.msg.fatal(bb.msg.domain.PersistData, "Please set the 'PERSISTENT_DIR' or 'CACHE' variable.")
         try:
             os.stat(self.cachedir)
         except OSError:

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.