From d5f6c1c1c56ba2d7c017398031ad10eba7087297 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 04 Apr 2019 16:56:29 -0400 Subject: patches, build: Set default conf file path to /etc/opkg/opkg.conf --- diff --git a/build b/build index fddb949..cd5263a 100755 --- a/build +++ b/build @@ -10,6 +10,7 @@ nop: build: (cd src && cmake \ -D CMAKE_INSTALL_PREFIX:PATH=/usr \ + -D CONF_FILE:STRING=/etc/opkg/opkg.conf -D STATIC_UBOX:BOOL=ON \ -D BUILD_TESTS:BOOL=OFF \ -D VERSION:STRING="$(version)" \ diff --git a/changelog b/changelog index b29f264..b21f26f 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,10 @@ +opkg-lede (0+git20190131.d4ba162-2) trunk + + * Add patch and build option to set default conf file path to + "/etc/opkg/opkg.conf". + + -- Patrick McDermott Thu, 04 Apr 2019 16:52:10 -0400 + opkg-lede (0+git20190131.d4ba162-1) trunk * Initial release. diff --git a/patches/0001-cli-Set-default-conf-file-path-in-build-system.patch b/patches/0001-cli-Set-default-conf-file-path-in-build-system.patch new file mode 100644 index 0000000..7a97d7a --- /dev/null +++ b/patches/0001-cli-Set-default-conf-file-path-in-build-system.patch @@ -0,0 +1,46 @@ +From 2fcd5f41c78e054840e9d19ea9935cbe7a05ca93 Mon Sep 17 00:00:00 2001 +From: Patrick McDermott +Date: Thu, 4 Apr 2019 16:55:39 -0400 +Subject: [PATCH] cli: Set default conf file path in build system + +--- + 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 + -- cgit v0.9.1