commit:     1ff2dedfee5b06d1ee67faf56938b3dc7b683907
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  8 09:00:56 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Apr  8 09:00:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1ff2dedf

tests: avoid string comparison in qdepends

Travis seems to not match this, so rewrite using a case-switch.  Perhaps
the shell used isn't bash or some version which doesn't grok the use I
envisioned.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 tests/qdepends/dotest | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/qdepends/dotest b/tests/qdepends/dotest
index ab5e2d3..11f7aad 100755
--- a/tests/qdepends/dotest
+++ b/tests/qdepends/dotest
@@ -24,13 +24,16 @@ test() {
        # qdepends output is based on a hash, which may differ based on
        # endiannes, so sort the output so we get a deterministic set
        while IFS= read -r line ; do
-               if [[ ${line} == *:* ]] ; then
+               case "${line}" in
+               *:*)
                        pkg=${line%%:*}
                        env LC_ALL=C \
                                echo "${pkg}: $(echo ${line#*:} | xargs -n1 | 
sort | xargs)"
-               else
+                       ;;
+               *)
                        echo "${line}"
-               fi
+                       ;;
+               esac
        done < list | diff list - | patch -s list
 
        local good="${as}/list${num}.good"

Reply via email to