Commit 153e9cb8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add do_exclude list and test for it

parent 80b459f1
# Args: LIST1 LIST2
# do_exclude_list print LIST2 with field contains in LIST1
do_exclude_list()
{
local i
local RES=
for i in $2 ; do
echo "$1" | grep -q -w $i || RES="$RES $i"
done
echo $RES
}
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod strings
LIST1="field1 field2"
LIST2="field1 field2 field3 field4"
LIST3="field"
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$3' do not match with '$2'" || echo "OK for '$1' with '$2'"
}
check 1 "field3 field4" "`do_exclude_list "$LIST1" "$LIST2"`"
check 2 "" "`do_exclude_list "$LIST2" "$LIST1"`"
check 3 "field" "`do_exclude_list "$LIST1" "$LIST3"`"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment