From patchwork Tue May 4 16:12:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Fedyk X-Patchwork-Id: 96829 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o44H73cB029274 for ; Tue, 4 May 2010 17:07:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932452Ab0EDRFn (ORCPT ); Tue, 4 May 2010 13:05:43 -0400 Received: from adsl-63-194-240-129.dsl.lsan03.pacbell.net ([63.194.240.129]:59756 "EHLO dt01.hm" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932407Ab0EDRFm (ORCPT ); Tue, 4 May 2010 13:05:42 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 04 May 2010 17:07:03 +0000 (UTC) X-Greylist: delayed 3219 seconds by postgrey-1.27 at vger.kernel.org; Tue, 04 May 2010 13:05:41 EDT Received: from localhost.localdomain (localhost [127.0.0.1]) by dt01.hm (8.14.3/8.14.3) with ESMTP id o44GC7vs003765 for ; Tue, 4 May 2010 09:12:07 -0700 From: Mike Fedyk Subject: [PATCH 2/2] Fix version.sh to work with dash To: linux-btrfs@vger.kernel.org Date: Tue, 04 May 2010 09:12:07 -0700 Message-ID: <20100504161207.3720.32821.stgit@localhost.localdomain> In-Reply-To: <20100504161201.3720.37609.stgit@localhost.localdomain> References: <20100504161201.3720.37609.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/version.h b/fs/btrfs/version.h index 9bf3946..12f7e5c 100644 --- a/fs/btrfs/version.h +++ b/fs/btrfs/version.h @@ -1,4 +1,4 @@ -#ifndef __BTRFS_VERSION_H -#define __BTRFS_VERSION_H -#define BTRFS_BUILD_VERSION "Btrfs" +#ifndef __BUILD_VERSION +#define __BUILD_VERSION +#define BTRFS_BUILD_VERSION "Btrfs 2010-05-04_08:46:49_-0700_ea1dcb3-dirty" #endif diff --git a/fs/btrfs/version.sh b/fs/btrfs/version.sh index a4576f2..0733eef 100755 --- a/fs/btrfs/version.sh +++ b/fs/btrfs/version.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/dash # # determine-version -- report a useful version for releases # @@ -8,10 +8,10 @@ v="v0.16" -which git &> /dev/null -if [ $? == 0 ]; then - git branch >& /dev/null - if [ $? == 0 ]; then +which git 2>&1 > /dev/null +if [ $? -eq 0 ]; then + git branch 2>&1 > /dev/null + if [ $? -eq 0 ]; then v="`git show --format='%ci_%h'|head -n 1|sed 's/[^a-z0-9_-:]/_/ig'`" # Are there uncommitted changes? @@ -19,7 +19,7 @@ if [ $? == 0 ]; then if git diff-index --name-only HEAD | \ grep -v "^scripts/package" \ | read dummy; then - v="$v"-dirty + v="${v}-dirty" fi fi fi @@ -29,9 +29,9 @@ echo "#define __BUILD_VERSION" >> .build-version.h echo "#define BTRFS_BUILD_VERSION \"Btrfs $v\"" >> .build-version.h echo "#endif" >> .build-version.h -diff -q version.h .build-version.h >& /dev/null +diff -q version.h .build-version.h 2>&1 > /dev/null -if [ $? == 0 ]; then +if [ $? -eq 0 ]; then rm .build-version.h exit 0 fi