diff options
author | 2021-12-27 19:12:06 +0100 | |
---|---|---|
committer | 2021-12-27 19:12:06 +0100 | |
commit | f1c5463c944bb646ac1bdf61dd5a74f64dcaa33b (patch) | |
tree | fad14e96ac3e5dd585db2b419f7583c9e815f7e7 /qmerge.c | |
parent | tests/init.sh.in: filter NOCOLOR, bug #830105 (diff) | |
download | portage-utils-f1c5463c944bb646ac1bdf61dd5a74f64dcaa33b.tar.gz portage-utils-f1c5463c944bb646ac1bdf61dd5a74f64dcaa33b.tar.bz2 portage-utils-f1c5463c944bb646ac1bdf61dd5a74f64dcaa33b.zip |
qmerge: resolve user sets from etc/portage/setsv0.93.3
Based on suggested patch from Barnabás Virágh in bug #816237. Look
inside sets subdir. While at it, accept @-prefixed syntax, e.g. @world.
Bug: https://bugs.gentoo.org/816237
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qmerge.c')
-rw-r--r-- | qmerge.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -1928,10 +1928,14 @@ qmerge_add_set_system(void *data, char *buf) static set * qmerge_add_set(char *buf, set *q) { - if (strcmp(buf, "world") == 0) + /* accept @world next to just "world" */ + if (*buf == '@') + buf++; + + if (strcmp(buf, "world") == 0) { return qmerge_add_set_file(CONFIG_EPREFIX, "/var/lib/portage", - "world", q); - else if (strcmp(buf, "all") == 0) { + "world", q); + } else if (strcmp(buf, "all") == 0) { tree_ctx *ctx = tree_open_vdb(portroot, portvdb); set *ret = NULL; if (ctx != NULL) { @@ -1939,12 +1943,13 @@ qmerge_add_set(char *buf, set *q) tree_close(ctx); } return ret; - } else if (strcmp(buf, "system") == 0) + } else if (strcmp(buf, "system") == 0) { return q_profile_walk("packages", qmerge_add_set_system, q); - else if (buf[0] == '@') + } else if (buf[0] == '@') { /* TODO: use configroot */ - return qmerge_add_set_file(CONFIG_EPREFIX, "/etc/portage", buf+1, q); - else { + return qmerge_add_set_file(CONFIG_EPREFIX, + "/etc/portage/sets", buf+1, q); + } else { rmspace(buf); return add_set(buf, q); } |