From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:37228 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbeEBIzI (ORCPT ); Wed, 2 May 2018 04:55:08 -0400 Date: Wed, 2 May 2018 16:55:03 +0800 From: Eryu Guan Subject: Re: [PATCH 8/9] xfs: checkbashisms in all script files Message-ID: <20180502085503.GE29084@desktop> References: <152518916007.23023.4793255395982876953.stgit@magnolia> <152518921090.23023.14958881774088486712.stgit@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152518921090.23023.14958881774088486712.stgit@magnolia> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, sandeen@sandeen.net, fstests@vger.kernel.org On Tue, May 01, 2018 at 08:40:10AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > Find all the /bin/sh scripts in xfsprogs and check for bashisms. > > Cc: sandeen@sandeen.net > Signed-off-by: Darrick J. Wong Looks fine to me, but I'd like a review from Eric too, as it's a "maintainer script" :) > --- > tests/xfs/711 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/xfs/711.out | 1 + > tests/xfs/group | 1 + > 3 files changed, 53 insertions(+) > create mode 100755 tests/xfs/711 > create mode 100644 tests/xfs/711.out > > > diff --git a/tests/xfs/711 b/tests/xfs/711 > new file mode 100755 > index 00000000..d3dc3cd4 > --- /dev/null > +++ b/tests/xfs/711 > @@ -0,0 +1,51 @@ > +#! /bin/bash > +# FS QA Test No. 711 > +# > +# checkbashisms on all /bin/sh scripts. This is a maintainer script. > +# > +#----------------------------------------------------------------------- > +# Copyright (c) 2018 Oracle, Inc. > +# > +# This program is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public License as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it would be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write the Free Software Foundation, > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > +# > +#----------------------------------------------------------------------- > +# > + > +seq=`basename $0` > +seqres=$RESULT_DIR/$seq > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=1 # failure is the default! > +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 > + > +# get standard environment > +. ./common/rc > + > +# real QA test starts here > +_supported_fs xfs > +_supported_os Linux > +export CHECKBASHISMS_PROG="`set_prog_path checkbashisms`" > +_require_command "$CHECKBASHISMS_PROG" checkbashisms > + > +test -z "$WORKAREA" && _notrun "Can't find xfsprogs source" > + > +rm -f $seqres.full > + > +find $WORKAREA -name 'xfs*.sh' -print0 | xargs -0 grep '^#!/bin/sh' | sed -e 's/:.*$//g' | while read f; do Do we care about spaces between "#!" and "/bin/sh"? i.e. "#! /bin/sh", sometimes there can be space(s). Thanks, Eryu > + $CHECKBASHISMS_PROG $f > +done > + > +status=0 > diff --git a/tests/xfs/711.out b/tests/xfs/711.out > new file mode 100644 > index 00000000..52ff4745 > --- /dev/null > +++ b/tests/xfs/711.out > @@ -0,0 +1 @@ > +QA output created by 711 > diff --git a/tests/xfs/group b/tests/xfs/group > index 39e259e8..b7da3fba 100644 > --- a/tests/xfs/group > +++ b/tests/xfs/group > @@ -443,3 +443,4 @@ > 443 auto quick ioctl fsr > 444 auto quick > 445 auto quick filestreams > +711 auto quick >