xfs
[Top] [All Lists]

[PATCH] xfstests comma separated group names

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfstests comma separated group names
From: Itaru Kitayama <itaru.kitayama@xxxxxxxxx>
Date: Mon, 20 May 2013 17:29:29 +0900
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=nSq7tV+GTtCCVM8xe/lVb+FEPafFA2GRtLxbSsg5ycc=; b=aZUiD6VEqpc3hyfgEj3XMLk20UBNnACnP+Y/4OnzuNj4BPYVNn/bQKimzRv1JX1jp9 PIypTvfEgg91vGo1vmi6G6RkepEEamkCCFLcastYCgg0LrcNVfJrn5LgeNdWPDMZw00N 8uuptfgZM7GRXWmGwrwFqUGmIO7tFNOa2A+9+2ePqBFN5YYAYmigxHSTj5c8uzVy88uJ mvH6fkiucSGatMdZDfsu6nNQdbnCYWeCBJLO+X69IF182ECjljG8oiTqi8xDRF4pTvsM +j50Tpn6v/8aRm/YMm5H4AtgUeiVbj2ukU4QXUYsZo103AjvDOmVjHzxsoQIr5I3ODSv lYAw==
This patch lets the -g option take multiple group names.

Signed-off-By: Itaru Kitayama <itaru.kitayama@xxxxxxxxx>

 check |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/check b/check
index a79747e..0e0f208 100755
--- a/check
+++ b/check
@@ -164,18 +164,19 @@ while [ $# -gt 0 ]; do
        -nfs)   FSTYP=nfs ;;
 
        -g)     group=$2 ; shift ;
-               group_list=$(get_group_list $group)
-               if [ -z "$group_list" ]; then
-                   echo "Group \"$group\" is empty or not defined?"
-                   exit 1
-               fi
-
-               [ ! -s $tmp.list ] && touch $tmp.list
-               for t in $group_list; do
-                       grep -s "^$t\$" $tmp.list >/dev/null || \
-                                                       echo "$t" >>$tmp.list
+               for g in ${group//,/ }; do
+                       group_list=$(get_group_list $g)
+                       if [ -z "$group_list" ]; then
+                       echo "Group \"$g\" is empty or not defined?"
+                       exit 1
+                       fi
+               
+                       [ ! -s $tmp.list ] && touch $tmp.list
+                       for t in $group_list; do
+                               grep -s "^$t\$" $tmp.list >/dev/null || \
+                                                               echo "$t" >>$tmp
+                       done
                done
-
                ;;
 
        -x)     xgroup=$2 ; shift ;
<Prev in Thread] Current Thread [Next in Thread>