From: Mike Fedyk <mfedyk@mikefedyk.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 2/2] Fix version.sh to work with dash
Date: Tue, 04 May 2010 10:47:38 -0700 [thread overview]
Message-ID: <20100504174738.4526.46612.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100504174733.4526.23527.stgit@localhost.localdomain>
---
fs/btrfs/version.sh | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/version.sh b/fs/btrfs/version.sh
index a4576f2..d87daf4 100755
--- a/fs/btrfs/version.sh
+++ b/fs/btrfs/version.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# 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
prev parent reply other threads:[~2010-05-04 17:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 17:47 [PATCH v2 1/2] Change version.sh from last tag and hash to output last commit date and hash Mike Fedyk
2010-05-04 17:47 ` Mike Fedyk [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100504174738.4526.46612.stgit@localhost.localdomain \
--to=mfedyk@mikefedyk.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).