xfs
[Top] [All Lists]

Re: [PATCH] xfstests comma separated group names

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfstests comma separated group names
From: Itaru Kitayama <itaru.kitayama@xxxxxxxxx>
Date: Tue, 21 May 2013 12:45:32 +0900
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iGC9tx3iEaObm3RF4xeJIa+2FuYJX4+rMR7j/4IuOa8=; b=Ckhwyty6mb+UNg1adRNrrekqvlbTppSX8ONkV18PycVJ7XWBc56CO5/8oQT489IG6t kZw1XfnfJCIyFuiTjHBsnTZrcFv0FakB9f6+nS9svNO0dvqLOdnZxCzFhkMp3eOrvsvA fpQNxiVEkWYP87uE0XwrvkTf5waGXqUHnsR3X3JJy8a/LzQ1JY99e9NvS3EEeDrrxfSM ao9C/jKaXrK9876/sJtpeCMJ2LPEBqhSXCP66nE73z0Q1KycOO8Mi5DqtYoi1a21KXwT rewQNzPt7HxuIQRte0v5hVs2pJ4Smv6KZDlPVKn2ZUy+evev7dZ9w0bTME6kxlcU8J0Y DLAQ==
In-reply-to: <20130521004553.GL24543@dastard>
References: <CANW9uytRpGXcd9x=HWMEoFvd3_9G98CN_Tv3YacTtd1h+Gq=4g@xxxxxxxxxxxxxx> <20130520113045.GB24543@dastard> <CANW9uytQDPaBr_VAGMuwSqhStCfyMCGmV_A3ccNzOExi-KeZfQ@xxxxxxxxxxxxxx> <20130521004553.GL24543@dastard>
In the current check script the -g option assumes only one group is given. With this patch, the -g option 
understands comma separated multiple groups as the argument as well. Existing scripts are not affected 
by this patch. 

Reviewed-by: Dave Chinner <david@xxxxxxxxxx>
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 ;


On Tue, May 21, 2013 at 9:45 AM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
On Mon, May 20, 2013 at 08:42:35PM +0900, Itaru Kitayama wrote:
> Yes, we can do that, but I just thought as you originally proposed last year
>
> -g rw,attr reads better.

Agreed, it does read better and is easily to type.

That's what you need to put in the commit message - why it is better
than what we currently have, and whether it is badwards compatible
or not (doesn't break any existing scripts). i.e. the commit
message is for telling people -why- the change should be made as we
can look at the code to determine -what- the change is.  ;)

Cheers,

Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>