All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] version.sh: clean up the code
@ 2009-01-19 13:51 Américo Wang
  2009-01-21 15:01 ` Chris Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Américo Wang @ 2009-01-19 13:51 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Chris Mason


- In bash, integer comparation should use '-eq', not '=='.
- Remove code for Mercurial, since btrfs now uses git.

Signed-off-by: WANG Cong <wangcong@zeuux.org>

---
diff --git a/version.sh b/version.sh
index 92c3953..e69f8f8 100644
--- a/version.sh
+++ b/version.sh
@@ -9,7 +9,7 @@
 v="Btrfs v0.17"
 
 which git &> /dev/null
-if [ $? == 0 -a -d .git ]; then
+if [ $? -eq 0 -a -d .git ]; then
     if head=`git rev-parse --verify HEAD 2>/dev/null`; then
         if tag=`git describe --tags 2>/dev/null`; then
             v="$tag"
@@ -23,26 +23,6 @@ if [ $? == 0 -a -d .git ]; then
         fi
     fi
 fi
-
-which hg &> /dev/null
-if [ $? == 0 -a -d .hg ]; then
-	last=$(hg tags | grep -m1 -o '^v[0-9.]\+')
-	 
-	# now check if the repo has commits since then...
-	if [[ $(hg id -t) == $last || \
-	    $(hg di -r "$last:." | awk '/^diff/{print $NF}' | sort -u) == .hgtags ]]
-	then
-	    # check if it's dirty
-	    if [[ $(hg id | cut -d' ' -f1) == *+ ]]; then
-		v=$last+
-	    else
-		v=$last
-	    fi
-	else
-	    # includes dirty flag
-	    v=$last+$(hg id -i)
-	fi
-fi
  
 echo "#ifndef __BUILD_VERSION" > .build-version.h
 echo "#define __BUILD_VERSION" >> .build-version.h
@@ -51,7 +31,7 @@ echo "#endif" >> .build-version.h
 
 diff -q version.h .build-version.h >& /dev/null
 
-if [ $? == 0 ]; then
+if [ $? -eq 0 ]; then
     rm .build-version.h
     exit 0
 fi



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] version.sh: clean up the code
  2009-01-19 13:51 [Patch] version.sh: clean up the code Américo Wang
@ 2009-01-21 15:01 ` Chris Mason
  2009-01-22 16:10   ` Américo Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Mason @ 2009-01-21 15:01 UTC (permalink / raw)
  To: Américo Wang; +Cc: linux-btrfs

On Mon, 2009-01-19 at 21:51 +0800, Am=C3=A9rico Wang wrote:
> - In bash, integer comparation should use '-eq', not '=3D=3D'.
> - Remove code for Mercurial, since btrfs now uses git.
>=20

version.sh should be removed from the mainline sources and only live in
the standalone tree.  So, I'll apply this one a bit later.

-chris


--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] version.sh: clean up the code
  2009-01-21 15:01 ` Chris Mason
@ 2009-01-22 16:10   ` Américo Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Américo Wang @ 2009-01-22 16:10 UTC (permalink / raw)
  To: Chris Mason; +Cc: linux-btrfs

On Wed, Jan 21, 2009 at 10:01:33AM -0500, Chris Mason wrote:
>On Mon, 2009-01-19 at 21:51 +0800, Am=C3=A9rico Wang wrote:
>> - In bash, integer comparation should use '-eq', not '=3D=3D'.
>> - Remove code for Mercurial, since btrfs now uses git.
>>=20
>
>version.sh should be removed from the mainline sources and only live i=
n
>the standalone tree.  So, I'll apply this one a bit later.
>

OK then.

--=20
"Against stupidity, the gods themselves, contend in vain."

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-22 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-19 13:51 [Patch] version.sh: clean up the code Américo Wang
2009-01-21 15:01 ` Chris Mason
2009-01-22 16:10   ` Américo Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.