Ignore comments when parsing arch.list, thanks to Fabian Groffen <grobian@gentoo...
authoridl0r <idl0r@gentoo.org>
Mon, 28 Sep 2009 18:57:19 +0000 (18:57 -0000)
committeridl0r <idl0r@gentoo.org>
Mon, 28 Sep 2009 18:57:19 +0000 (18:57 -0000)
svn path=/trunk/gentoolkit-dev/; revision=687

ChangeLog
src/eshowkw/eshowkw

index 44159b61261f4f9708c09d019d8f61f6c1b169b6..779aafe49a58c84e168475832d4568ce6aaca550 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2009-28-09: Christian Ruppert <idl0r@gentoo.org>
        * src/eshowkw/eshowkw: Make eshowkw a bit more POSIX compliant when using
                /bin/sh, thanks to Daniel Pielmeier <billie@gentoo.org>.
+               Ignore comments when parsing arch.list, thanks to Fabian Groffen <grobian@gentoo.org>.
+
 2009-12-09: Christian Ruppert <idl0r@gentoo.org>
        * src/echangelog/echangelog: Fix bug 284657, thanks to Andrew Gaffney <agaffney@gentoo.org>.
                Cleanup VCS detection.
index ae5f3d0ef35e75b3d5de3f6334fce16308451ea6..d5d3584c6a890a4b08334af4c96ac6fce62ae709 100644 (file)
@@ -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 ./ ) )