From patchwork Tue Feb 26 20:42:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2187461 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AE5343FD4E for ; Tue, 26 Feb 2013 20:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758999Ab3BZUmn (ORCPT ); Tue, 26 Feb 2013 15:42:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28301 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758711Ab3BZUmn (ORCPT ); Tue, 26 Feb 2013 15:42:43 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1QKgdPA019740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Feb 2013 15:42:39 -0500 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1QKgcnM012372 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 26 Feb 2013 15:42:38 -0500 Message-ID: <512D1E3E.9050907@redhat.com> Date: Tue, 26 Feb 2013 14:42:38 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: xfs-oss , linux-btrfs , Stefan Behrens Subject: [PATCH] xfstests: handle new mkfs.btrfs -f option cleanly X-Enigmail-Version: 1.5 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org I added an "-f" option to mkfs.btrfs to force overwrite of an existing filesystem. Now on an xfstests run, new mkfs.btrfs requires it, and old mkfs.btrfs cannot accept it. So, add a helper which works out whether -f is needed, and add it to the MKFS_BTRFS_PROG env. var as necessary, so that it is an always-included option during the tests. Signed-off-by: Eric Sandeen Reviewed-by: Rich Johnston Reviewed-by: Rich Johnston --- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common.config b/common.config index 57f505d..9f1d309 100644 --- a/common.config +++ b/common.config @@ -101,6 +101,17 @@ set_prog_path() return 1 } +# Handle mkfs.btrfs which does (or does not) require -f to overwrite +set_btrfs_mkfs_prog_path_with_opts() +{ + p=`set_prog_path mkfs.btrfs` + if grep -q 'force overwrite' $p; then + echo "$p -f" + else + echo $p + fi +} + _fatal() { echo "$*" @@ -185,7 +196,7 @@ case "$HOSTOS" in Linux) export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`" export MKFS_UDF_PROG="`set_prog_path mkudffs`" - export MKFS_BTRFS_PROG="`set_prog_path mkfs.btrfs`" + export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`" export BTRFS_UTIL_PROG="`set_prog_path btrfs`" export XFS_FSR_PROG="`set_prog_path xfs_fsr`" export MKFS_NFS_PROG="false"