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 6D0DF138C9D for ; Tue, 28 Apr 2015 14:56:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 07731E08CA; Tue, 28 Apr 2015 14:56:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 93361E08CA for ; Tue, 28 Apr 2015 14:56:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 65F4C340C79 for ; Tue, 28 Apr 2015 14:56:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3271E978 for ; Tue, 28 Apr 2015 14:56:00 +0000 (UTC) From: "Vadim A. Misbakh-Soloviov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Vadim A. Misbakh-Soloviov" Message-ID: <1430232939.9737be28efe8cf3668d4f0625382f9184db4c49a.mva@gentoo> Subject: [gentoo-commits] proj/zsh-completion:master commit in: src/ X-VCS-Repository: proj/zsh-completion X-VCS-Files: src/_gentoo_repos X-VCS-Directories: src/ X-VCS-Committer: mva X-VCS-Committer-Name: Vadim A. Misbakh-Soloviov X-VCS-Revision: 9737be28efe8cf3668d4f0625382f9184db4c49a X-VCS-Branch: master Date: Tue, 28 Apr 2015 14:56:00 +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: e9b22645-5786-4c63-b713-d48527dc4ad5 X-Archives-Hash: f758ffa12baa533af0f7f1f21b535cbe commit: 9737be28efe8cf3668d4f0625382f9184db4c49a Author: Vadim A. Misbakh-Soloviov mva name> AuthorDate: Tue Apr 28 14:55:39 2015 +0000 Commit: Vadim A. Misbakh-Soloviov mva name> CommitDate: Tue Apr 28 14:55:39 2015 +0000 URL: https://gitweb.gentoo.org/proj/zsh-completion.git/commit/?id=9737be28 _gentoo_repos: some algo rework. Probably fixes #3 Signed-off-by: Vadim A. Misbakh-Soloviov mva.name> src/_gentoo_repos | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/_gentoo_repos b/src/_gentoo_repos index 7f88a64..85f3936 100644 --- a/src/_gentoo_repos +++ b/src/_gentoo_repos @@ -6,9 +6,12 @@ # _gentoo_repos -o -> returns the list of non-main repos _gentoo_repos() { - local main_repo main_repo_path overlay overlay_paths + local main_repo main_repo_path overlay overlay_paths result - if [[ -e /usr/share/portage/config/repos.conf ]]; then + overlay_paths=(); + result=(); + + if [[ -e /usr/share/portage/config/repos.conf || -e /etc/portage/repos.conf ]]; then main_repo=$(_repos_conf DEFAULT main-repo) main_repo_path=$(_repos_conf ${main_repo} location) @@ -30,16 +33,20 @@ _gentoo_repos() { fi if [[ $1 == "-m" ]]; then - echo "${main_repo_path}" + result+=(${main_repo_path}) elif [[ $1 == "-o" ]]; then - echo "${(@u)overlay_paths}" + result+=(${(@)overlay_paths}) else - echo "${main_repo_path} ${(@u)overlay_paths}" + result+=(${main_repo_path} ${(@)overlay_paths}) fi + + echo ${(u)result} } _repos_conf() { - local v file insection section arr + local v file insection section arr secname + + secname=(); for file in /usr/share/portage/config/repos.conf \ /etc/portage/repos.conf \ @@ -74,7 +81,7 @@ _repos_conf() { done if [[ ${1} == "-l" ]]; then - echo "${(@)secname}" + echo "${(@u)secname}" else echo "${v}" fi