diff options
| author | 2016-06-02 11:16:03 -0400 | |
|---|---|---|
| committer | 2016-06-02 11:16:03 -0400 | |
| commit | b613790793b46ccc596e1dc28163ea865d508b65 (patch) | |
| tree | 3e1349d007039d85b135779702a5503d6b126e39 | |
| parent | cross-pkg-config: fix typo w/pkg_config (diff) | |
| download | crossdev-b613790793b46ccc596e1dc28163ea865d508b65.tar.gz crossdev-b613790793b46ccc596e1dc28163ea865d508b65.tar.bz2 crossdev-b613790793b46ccc596e1dc28163ea865d508b65.zip | |
crossdev: handle multiple repos at same prio level
This helps fix an infinite recursion issue when trying to load the
multilib eclass environment.
URL: https://bugs.gentoo.org/531044
URL: https://bugs.gentoo.org/540586
Reported-by: Ulrar <lemonnier.k@gmail.com>
Reported-by: Malte Starostik <bugs@xodtsoq.de>
Reported-by: Samuel Loewen <samuellwn@gmail.com>
| -rwxr-xr-x | crossdev | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -319,12 +319,18 @@ parse_repo_config() { # priority = 0 local repo_config=$(portageq repositories_configuration "${ROOT}") local flat_config=$(echo "${repo_config}" | gawk ' + function push(arr, idx, ele) { + if (idx in arr) + arr[idx][length(arr) + 1] = ele + else + arr[idx][0] = ele + } { if ($1 == "main-repo") { main_repo = $NF } else if ($1 ~ /^\[/) { if (repo_name && loc) - repos[prio] = repo_name ":" loc + push(repos, prio, repo_name ":" loc) repo_name = gensub(/\[([^\]]*)\]/, "\\1", 1, $1) loc = prio = "" } else if ($1 == "priority") { @@ -334,12 +340,13 @@ parse_repo_config() { } } END { - repos[prio] = repo_name ":" loc + push(repos, prio, repo_name ":" loc) print(main_repo) asorti(repos, prios) for (prio in prios) - print(repos[prios[prio]]) + for (repo in repos[prios[prio]]) + print(repos[prios[prio]][repo]) } ') |
