summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch')
-rw-r--r--meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch b/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch
new file mode 100644
index 0000000000..3313bf7687
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch
@@ -0,0 +1,93 @@
1From 541b6b7bd80dc321493e42955d93b277af0c9221 Mon Sep 17 00:00:00 2001
2From: Paul Eggleton <paul.eggleton@linux.intel.com>
3Date: Mon, 9 Jul 2012 11:01:15 +0100
4Subject: [PATCH 5/7] Do not read /etc/opkg/*.conf if -f is specified
5
6If a configuration file is specified on the command line, we should
7assume it contains all of the configuration and not try to read the
8configuration in /etc/opkg.
9
10Upstream-Status: Submitted
11http://code.google.com/p/opkg/issues/detail?id=93
12
13Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15---
16 libopkg/opkg_conf.c | 55 +++++++++++++++++++++++++++--------------------------
17 1 file changed, 28 insertions(+), 27 deletions(-)
18
19diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
20index 4711ce7..1e65bad 100644
21--- a/libopkg/opkg_conf.c
22+++ b/libopkg/opkg_conf.c
23@@ -473,39 +473,40 @@ opkg_conf_load(void)
24 &conf->pkg_src_list, &conf->dist_src_list))
25 goto err1;
26 }
27-
28- if (conf->offline_root)
29- sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", conf->offline_root);
30 else {
31- const char *conf_file_dir = getenv("OPKG_CONF_DIR");
32- if (conf_file_dir == NULL)
33- conf_file_dir = OPKG_CONF_DEFAULT_CONF_FILE_DIR;
34- sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir);
35- }
36-
37- memset(&globbuf, 0, sizeof(globbuf));
38- glob_ret = glob(etc_opkg_conf_pattern, 0, glob_errfunc, &globbuf);
39- if (glob_ret && glob_ret != GLOB_NOMATCH) {
40- free(etc_opkg_conf_pattern);
41- globfree(&globbuf);
42- goto err1;
43- }
44-
45- free(etc_opkg_conf_pattern);
46+ if (conf->offline_root)
47+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", conf->offline_root);
48+ else {
49+ const char *conf_file_dir = getenv("OPKG_CONF_DIR");
50+ if (conf_file_dir == NULL)
51+ conf_file_dir = OPKG_CONF_DEFAULT_CONF_FILE_DIR;
52+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir);
53+ }
54
55- for (i = 0; i < globbuf.gl_pathc; i++) {
56- if (globbuf.gl_pathv[i])
57- if (conf->conf_file &&
58- !strcmp(conf->conf_file, globbuf.gl_pathv[i]))
59- continue;
60- if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
61- &conf->pkg_src_list, &conf->dist_src_list)<0) {
62+ memset(&globbuf, 0, sizeof(globbuf));
63+ glob_ret = glob(etc_opkg_conf_pattern, 0, glob_errfunc, &globbuf);
64+ if (glob_ret && glob_ret != GLOB_NOMATCH) {
65+ free(etc_opkg_conf_pattern);
66 globfree(&globbuf);
67 goto err1;
68 }
69- }
70
71- globfree(&globbuf);
72+ free(etc_opkg_conf_pattern);
73+
74+ for (i = 0; i < globbuf.gl_pathc; i++) {
75+ if (globbuf.gl_pathv[i])
76+ if (conf->conf_file &&
77+ !strcmp(conf->conf_file, globbuf.gl_pathv[i]))
78+ continue;
79+ if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
80+ &conf->pkg_src_list, &conf->dist_src_list)<0) {
81+ globfree(&globbuf);
82+ goto err1;
83+ }
84+ }
85+
86+ globfree(&globbuf);
87+ }
88
89 if (conf->offline_root)
90 sprintf_alloc (&lock_file, "%s/%s", conf->offline_root, OPKGLOCKFILE);
91--
921.7.12
93