File: deb-config.patch

package info (click to toggle)
drslib 0.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,544 kB
  • sloc: python: 6,119; xml: 988; makefile: 128; sh: 121
file content (29 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: Set default MIP_TABLE_PATH on debian.
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2011-11-23
Forwarded: no

Index: drslib-0.3.1.p3/drslib/config.py
===================================================================
--- drslib-0.3.1.p3.orig/drslib/config.py
+++ drslib-0.3.1.p3/drslib/config.py
@@ -37,10 +37,17 @@ else:
     try:
         table_path = config.get('tables', 'path')
     except:
-        raise Exception("Please configure your MIP table path using MIP_TABLE_PATH or a config file")
+        # On Debian, the user may have cmip5-cmor-tables installed. Fall back to these.
+        if os.path.exists('/usr/share/cmor'):
+           table_path ='/usr/share/cmor'
+        else:
+            raise Exception("Please configure your MIP table path using MIP_TABLE_PATH or a config file")
 
 try:
-    table_path_csv = config.get('tables', 'path_csv')
+    if os.path.exists('/usr/share/cmor'):
+        table_path_csv = '/usr/share/cmor'
+    else:
+        table_path_csv = config.get('tables', 'path_csv')
 except:
     table_path_csv = '%s_csv' % os.path.normpath(table_path)