From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6A19C13829C for ; Thu, 2 Jun 2016 15:56:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F38DB21C039; Thu, 2 Jun 2016 15:56:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 51A0F21C03E for ; Thu, 2 Jun 2016 15:56:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B7295340E57 for ; Thu, 2 Jun 2016 15:56:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 23A6A980 for ; Thu, 2 Jun 2016 15:56:42 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1464880563.b613790793b46ccc596e1dc28163ea865d508b65.vapier@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: / X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: b613790793b46ccc596e1dc28163ea865d508b65 X-VCS-Branch: master Date: Thu, 2 Jun 2016 15:56:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4ab13b7a-c243-434a-bceb-72264b98c1e4 X-Archives-Hash: 018f35c2899006eafe966fe1e3e03c68 commit: b613790793b46ccc596e1dc28163ea865d508b65 Author: Mike Frysinger gentoo org> AuthorDate: Thu Jun 2 15:16:03 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Jun 2 15:16:03 2016 +0000 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=b6137907 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 gmail.com> Reported-by: Malte Starostik xodtsoq.de> Reported-by: Samuel Loewen gmail.com> crossdev | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crossdev b/crossdev index 29bea33..686b906 100755 --- a/crossdev +++ b/crossdev @@ -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]) } ')