]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: fix the -V option for most shell scripts
authorChristoph Hellwig <hch@lst.de>
Wed, 9 Sep 2009 17:24:38 +0000 (14:24 -0300)
committerhch@lst.de <Christoph Hellwig>
Wed, 9 Sep 2009 17:24:38 +0000 (14:24 -0300)
For most of the shellscripts wrapping xfs_db or xfs_growfs the -V option
is not implemented correctly.  If we just add -V to the options for the
underlying binaries we will never actually call it because the mandatory
device / mount point argument is missing.  Instead just call the underlying
command with -V directly and exit early.  This is what xfs_bmap.sh,
xfs_mkfile and xfs_metadump.sh are already doing.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Michael Monnerie <michael.monnerie@is.it-management.at>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
db/xfs_admin.sh
db/xfs_check.sh
db/xfs_ncheck.sh
growfs/xfs_info.sh

index 74d457c29e313b92a001289cacac622e442b405e..a7a3fdbc3f7b8b85e2d537fc6c1f111498b2d234 100755 (executable)
@@ -19,7 +19,10 @@ do
        L)      DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";;
        u)      DB_OPTS=$DB_OPTS" -r -c uuid";;
        U)      DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'";;
-       V)      DB_OPTS=$DB_OPTS" -V";;
+       V)      xfs_db -p xfs_admin -V
+               status=$?
+               exit $status
+               ;;
        \?)     echo $USAGE 1>&2
                exit 2
                ;;
index 7f141f92333f54f39978ae993571e37b6e8dc799..c76b5403facffc086abf7a5fd285dd18dd160e45 100755 (executable)
@@ -13,11 +13,14 @@ do
        s)      OPTS=$OPTS"-s ";;
        t)      OPTS=$OPTS"-t ";;
        v)      OPTS=$OPTS"-v ";;
-       V)      OPTS=$OPTS"-V ";;
        i)      OPTS=$OPTS"-i "$OPTARG" ";;
        b)      OPTS=$OPTS"-b "$OPTARG" ";;
        f)      DBOPTS=$DBOPTS" -f";;
        l)      DBOPTS=$DBOPTS" -l "$OPTARG" ";;
+       V)      xfs_db -p xfs_check -V
+               status=$?
+               exit $status
+               ;;
        \?)     echo $USAGE 1>&2
                exit 2
                ;;
index e228ecade41f97136411fe9e6e7f70241e4da095..f008882f47f0a8c0789567ace26e5c8f13909b07 100755 (executable)
@@ -14,9 +14,12 @@ do
        s)      OPTS=$OPTS"-s ";;
        i)      OPTS=$OPTS"-i "$OPTARG" ";;
        v)      OPTS=$OPTS"-v ";;
-       V)      OPTS=$OPTS"-V ";;
        f)      DBOPTS=$DBOPTS" -f";;
        l)      DBOPTS=$DBOPTS" -l "$OPTARG" ";;
+       V)      xfs_db -p xfs_ncheck -V
+               status=$?
+               exit $status
+               ;;
        \?)     echo $USAGE 1>&2
                exit 2
                ;;
index a9f6036720ba776ff01ec0841c3be0696d323962..b85f120f3b3016f877cfc99b231165358ca421ec 100755 (executable)
@@ -10,7 +10,10 @@ while getopts "t:V" c
 do
        case $c in
        t)      OPTS="-t $OPTARG" ;;
-       V)      OPTS="-V $OPTARG" ;;
+       V)      xfs_growfs -p xfs_info -V
+               status=$?
+               exit $status
+               ;;
        *)      echo $USAGE 1>&2
                exit 2
                ;;