]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
make the version.sh script posix compatible
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 17 Sep 2008 07:53:32 +0000 (09:53 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Wed, 17 Sep 2008 07:53:32 +0000 (09:53 +0200)
version.sh

index b21d67149ecc634abbb0564efdbc416fb477ea0d..0c33d6688c0ea6330e5774dafdbeed3dfeabebd3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 VERSION="0.9.2"
 
@@ -9,10 +9,10 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 
        # on git builds check that the version number above
        # is correct...
-       [ "${descr/-*/}" == "v$VERSION" ] || exit 2
+       [ "${descr%%-*}" = "v$VERSION" ] || exit 2
        
        echo -n '#define IW_VERSION "'
-       echo -n "${descr:1}"
+       echo -n "${descr#v}"
        if git diff-index --name-only HEAD | read dummy ; then
                echo -n "-dirty"
        fi