From fe8bb304a1e75b7fb6481ba0c66faffbae94e7b3 Mon Sep 17 00:00:00 2001 From: idl0r Date: Mon, 28 Sep 2009 18:57:19 +0000 Subject: [PATCH] Ignore comments when parsing arch.list, thanks to Fabian Groffen . svn path=/trunk/gentoolkit-dev/; revision=687 --- ChangeLog | 2 ++ src/eshowkw/eshowkw | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44159b6..779aafe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2009-28-09: Christian Ruppert * src/eshowkw/eshowkw: Make eshowkw a bit more POSIX compliant when using /bin/sh, thanks to Daniel Pielmeier . + Ignore comments when parsing arch.list, thanks to Fabian Groffen . + 2009-12-09: Christian Ruppert * src/echangelog/echangelog: Fix bug 284657, thanks to Andrew Gaffney . Cleanup VCS detection. diff --git a/src/eshowkw/eshowkw b/src/eshowkw/eshowkw index ae5f3d0..d5d3584 100644 --- a/src/eshowkw/eshowkw +++ b/src/eshowkw/eshowkw @@ -283,11 +283,16 @@ show_keyword_diagram() { echo -e "\033[0;0m:" echo - local archs= arch_length=0 arch= - archs=( $(< $(get_portage_dir )/profiles/arch.list ) ) - for arch in "${archs[@]}" ; do + local archs=() arch_length=0 arch= + while read arch + do + [[ -z "${arch}" ]] && continue + [[ "${arch:0:1}" == "#" ]] && continue [[ ${#arch} -gt ${arch_length} ]] && arch_length=${#arch} - done + + archs[${#archs[*]}]=$arch + done < "$(get_portage_dir)/profiles/arch.list" + local versions= pkgname= version_length=0 version= pkgname=$(basename $(readlink -f ./ ) ) -- 2.26.2