about summary refs log tree commit diff
path: root/modules/user/aszlig/programs/taskwarrior/config.patch
blob: 4ee4c4ce78433948202980af5583f0c88cecaf25 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5558f6b..c8956f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,6 +91,9 @@ SET (TASK_DOCDIR  share/doc/task CACHE STRING "Installation directory for doc fi
 SET (TASK_RCDIR "${TASK_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files")
 SET (TASK_BINDIR  bin            CACHE STRING "Installation directory for the binary")
 
+SET (SYSTEM_TASKRC "${CMAKE_INSTALL_PREFIX}/etc/taskrc"
+     CACHE STRING "System-wide taskrc")
+
 message ("-- Looking for SHA1 references")
 if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
   set (HAVE_COMMIT true)
diff --git a/cmake.h.in b/cmake.h.in
index 0041e6e..f8c1a0e 100644
--- a/cmake.h.in
+++ b/cmake.h.in
@@ -16,6 +16,7 @@
 
 /* Installation details */
 #define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}"
+#define SYSTEM_TASKRC "${SYSTEM_TASKRC}"
 
 /* Localization */
 #define PACKAGE_LANGUAGE ${PACKAGE_LANGUAGE}
diff --git a/src/Context.cpp b/src/Context.cpp
index 8aae74e..ffa5557 100644
--- a/src/Context.cpp
+++ b/src/Context.cpp
@@ -121,7 +121,8 @@ int Context::initialize (int argc, const char** argv)
     }
 
     config.clear ();
-    config.load (rc_file);
+    config.load (SYSTEM_TASKRC);
+    config.load (rc_file, 2);
     CLI2::applyOverrides (argc, argv);
 
     ////////////////////////////////////////////////////////////////////////////
@@ -146,7 +147,6 @@ int Context::initialize (int argc, const char** argv)
     }
 
     tdb2.set_location (data_dir);
-    createDefaultConfig ();
 
     ////////////////////////////////////////////////////////////////////////////
     //