summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_conf.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-06-14 01:43:35 (EDT)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-06-14 01:43:35 (EDT)
commita2f5f54adba4fa703f11f4d94756911db83ed2a4 (patch)
tree296a2c26eb997fcd6b5c706d5b81844c995499e5 /libopkg/opkg_conf.c
parent10f0dceaf9ed1dea7c2ed7d41e7a748d34dd9324 (diff)
adds a configure option so "/etc/opkg" can be
changed when opkg is configured and built. fix issue due to an error of opkg_conf.c Thanks to jlc <jlcster@gmail.com> http://groups.google.com/group/opkg-devel/browse_thread/thread/5c6e55832a7168aa git-svn-id: http://opkg.googlecode.com/svn/trunk@213 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_conf.c')
-rw-r--r--libopkg/opkg_conf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
index 0479b8a..fbbd2b2 100644
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
@@ -21,7 +21,7 @@
#include "xregex.h"
#include "sprintf_alloc.h"
-#include "opkg_conf.h"
+#include "args.h"
#include "opkg_message.h"
#include "file_util.h"
#include "str_util.h"
@@ -33,6 +33,8 @@
#include <sys/stat.h>
#include <fcntl.h>
+extern char *conf_file_dir;
+
static int opkg_conf_parse_file(opkg_conf_t *conf, const char *filename,
pkg_src_list_t *pkg_src_list,
nv_pair_list_t *tmp_dest_nv_pair_list,
@@ -110,7 +112,7 @@ int opkg_conf_init(opkg_conf_t *conf, const args_t *args)
nv_pair_list_t tmp_dest_nv_pair_list;
char *lists_dir = NULL, *lock_file = NULL;
glob_t globbuf;
- char *etc_opkg_conf_pattern = "/etc/opkg/*.conf";
+ char *etc_opkg_conf_pattern;
char *pending_dir = NULL;
memset(conf, 0, sizeof(opkg_conf_t));
@@ -192,10 +194,11 @@ int opkg_conf_init(opkg_conf_t *conf, const args_t *args)
if (args->offline_root)
sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", args->offline_root);
+ else
+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir);
memset(&globbuf, 0, sizeof(globbuf));
err = glob(etc_opkg_conf_pattern, 0, NULL, &globbuf);
- if (args->offline_root)
- free (etc_opkg_conf_pattern);
+ free (etc_opkg_conf_pattern);
if (!err) {
int i;
for (i = 0; i < globbuf.gl_pathc; i++) {