public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] proj/portage-utils:master commit in: /
@ 2015-11-26 10:39 99% Mike Frysinger
  0 siblings, 0 replies; 1+ results
From: Mike Frysinger @ 2015-11-26 10:39 UTC (permalink / raw
  To: gentoo-commits

commit:     6c23cea972914761a0b1d4c79326da9f0352e758
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 09:39:13 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 09:39:13 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6c23cea9

main: load all overlays from repos.conf

No code currently uses this, but we'll start to cut over utils.

URL: https://bugs.gentoo.org/553260

 main.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/main.c b/main.c
index c4b9bcc..8c7403b 100644
--- a/main.c
+++ b/main.c
@@ -72,6 +72,8 @@ void init_coredumps(void)
 /* include common library code */
 #include "libq/libq.c"
 
+static DECLARE_ARRAY(overlays);
+
 _q_static
 void no_colors(void)
 {
@@ -424,19 +426,30 @@ contents_entry *contents_parse_line(char *line)
 /* Handle a single file in the repos.conf format. */
 static void read_one_repos_conf(const char *repos_conf)
 {
+	int nsec;
 	char *conf;
-	const char *repo, *path;
+	const char *main_repo, *repo, *path;
 	dictionary *dict;
 
 	dict = iniparser_load(repos_conf);
 
-	repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
-	if (repo) {
+	main_repo = iniparser_getstring(dict, "DEFAULT:main-repo", NULL);
+
+	nsec = iniparser_getnsec(dict);
+	while (nsec-- > 0) {
+		repo = iniparser_getsecname(dict, nsec);
+		if (!strcmp(repo, "DEFAULT"))
+			continue;
+
 		xasprintf(&conf, "%s:location", repo);
 		path = iniparser_getstring(dict, conf, NULL);
 		if (path) {
-			free(portdir);
-			portdir = xstrdup(path);
+			if (main_repo && !strcmp(repo, main_repo)) {
+				free(portdir);
+				portdir = xstrdup(path);
+			}
+
+			xarraypush_str(overlays, path);
 		}
 		free(conf);
 	}


^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-11-26 10:39 99% [gentoo-commits] proj/portage-utils:master commit in: / Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox