summaryrefslogtreecommitdiffstats
path: root/patches/0001-cli-Set-default-conf-file-path-in-build-system.patch
blob: fd2c91d04ef7c945215f047849a2e124db42783d (plain)
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
From 2afcd1b6890f34e7723dc032f0aedb85c409f589 Mon Sep 17 00:00:00 2001
From: Patrick McDermott <patrick.mcdermott@libiquity.com>
Date: Thu, 4 Apr 2019 16:55:39 -0400
Subject: [PATCH] cli: Set default conf file path in build system

Signed-off-by: Patrick McDermott <patrick.mcdermott@libiquity.com>
---
 CMakeLists.txt | 2 ++
 src/opkg-cl.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 26230b3..5ad0b36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ INCLUDE(TestBigEndian)
 
 SET(HOST_CPU "" CACHE STRING "Override Host CPU")
 SET(BUILD_CPU "" CACHE STRING "Override Host CPU")
+SET(CONF_FILE "/etc/opkg.conf" CACHE STRING "Override default configuration file path")
 SET(LOCK_FILE "/var/lock/opkg.lock" CACHE STRING "Override lock file path")
 SET(PATH_SPEC "/usr/sbin:/usr/bin:/sbin:/bin" CACHE STRING "Override default PATH value")
 SET(VERSION "" CACHE STRING "Override version")
@@ -38,6 +39,7 @@ TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
 ADD_DEFINITIONS(-Os -Wall --std=gnu99 -g3 -Wmissing-declarations
 	-DDATADIR="/usr/share"
 	-DOPKGETCDIR="/etc"
+	-DOPKGCONFFILE="${CONF_FILE}"
 	-DOPKGLOCKFILE="${LOCK_FILE}"
 	-DOPKGLIBDIR="/usr/lib"
 	-DHOST_CPU_STR="${HOST_CPU}"
diff --git a/src/opkg-cl.c b/src/opkg-cl.c
index a3ea5c1..a299514 100644
--- a/src/opkg-cl.c
+++ b/src/opkg-cl.c
@@ -244,7 +244,7 @@ static int args_parse(int argc, char *argv[])
 	}
 
 	if (!conf->conf_file && !conf->offline_root)
-		conf->conf_file = xstrdup("/etc/opkg.conf");
+		conf->conf_file = xstrdup(OPKGCONFFILE);
 
 	if (parse_err)
 		return parse_err;
-- 
2.11.0