From 50395b71a90314abfcc39d8343dbaa8e9aa199a6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Jul 2012 17:36:07 -0400 Subject: Fix the substituter tests --- tests/substituter2.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'tests/substituter2.sh') diff --git a/tests/substituter2.sh b/tests/substituter2.sh index c56a1bc47b5c..34b2c0eafaf8 100755 --- a/tests/substituter2.sh +++ b/tests/substituter2.sh @@ -2,21 +2,23 @@ echo substituter2 args: $* >&2 if test $1 = "--query"; then - while read cmd; do - if test "$cmd" = "have"; then - read path - if grep -q "$path" $TEST_ROOT/sub-paths; then - echo 1 - else - echo 0 - fi - elif test "$cmd" = "info"; then - read path - echo 1 - echo "" # deriver - echo 0 # nr of refs - echo 0 # download size - echo 0 # nar size + while read cmd args; do + if test "$cmd" = have; then + for path in $args; do + if grep -q "$path" $TEST_ROOT/sub-paths; then + echo $path + fi + done + echo + elif test "$cmd" = info; then + for path in $args; do + echo $path + echo "" # deriver + echo 0 # nr of refs + echo 0 # download size + echo 0 # nar size + done + echo else echo "bad command $cmd" exit 1 -- cgit 1.4.1