summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:17:57 (EST)
committer pixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:17:57 (EST)
commitc2bab50c95c1e90fdb8ab2c31161f8a416c56e98 (patch)
tree114b8fefcc81382288551f3f406a1e1167cd4d43
parent0497af4e81defd66d0ba4d475c47ff617b31906a (diff)
Do not read /etc/opkg/*.conf if -f is specified
If a configuration file is specified on the command line, we should assume it contains all of the configuration and not try to read the configuration in /etc/opkg. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@640 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_conf.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
index 4711ce7..1e65bad 100644
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
@@ -473,39 +473,40 @@ opkg_conf_load(void)
&conf->pkg_src_list, &conf->dist_src_list))
goto err1;
}
-
- if (conf->offline_root)
- sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", conf->offline_root);
else {
- const char *conf_file_dir = getenv("OPKG_CONF_DIR");
- if (conf_file_dir == NULL)
- conf_file_dir = OPKG_CONF_DEFAULT_CONF_FILE_DIR;
- sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir);
- }
-
- memset(&globbuf, 0, sizeof(globbuf));
- glob_ret = glob(etc_opkg_conf_pattern, 0, glob_errfunc, &globbuf);
- if (glob_ret && glob_ret != GLOB_NOMATCH) {
- free(etc_opkg_conf_pattern);
- globfree(&globbuf);
- goto err1;
- }
-
- free(etc_opkg_conf_pattern);
+ if (conf->offline_root)
+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", conf->offline_root);
+ else {
+ const char *conf_file_dir = getenv("OPKG_CONF_DIR");
+ if (conf_file_dir == NULL)
+ conf_file_dir = OPKG_CONF_DEFAULT_CONF_FILE_DIR;
+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir);
+ }
- for (i = 0; i < globbuf.gl_pathc; i++) {
- if (globbuf.gl_pathv[i])
- if (conf->conf_file &&
- !strcmp(conf->conf_file, globbuf.gl_pathv[i]))
- continue;
- if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
- &conf->pkg_src_list, &conf->dist_src_list)<0) {
+ memset(&globbuf, 0, sizeof(globbuf));
+ glob_ret = glob(etc_opkg_conf_pattern, 0, glob_errfunc, &globbuf);
+ if (glob_ret && glob_ret != GLOB_NOMATCH) {
+ free(etc_opkg_conf_pattern);
globfree(&globbuf);
goto err1;
}
- }
- globfree(&globbuf);
+ free(etc_opkg_conf_pattern);
+
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+ if (globbuf.gl_pathv[i])
+ if (conf->conf_file &&
+ !strcmp(conf->conf_file, globbuf.gl_pathv[i]))
+ continue;
+ if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
+ &conf->pkg_src_list, &conf->dist_src_list)<0) {
+ globfree(&globbuf);
+ goto err1;
+ }
+ }
+
+ globfree(&globbuf);
+ }
if (conf->offline_root)
sprintf_alloc (&lock_file, "%s/%s", conf->offline_root, OPKGLOCKFILE);