]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
fix version script to include header and not write file twice
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 2 Jul 2009 07:09:13 +0000 (09:09 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Thu, 2 Jul 2009 07:09:13 +0000 (09:09 +0200)
version.sh

index 63c1e0da158c712907a6b0fa1a39af9fa8216a35..74f852e9be71085aabb0e32d612bb4f779102211 100755 (executable)
@@ -3,6 +3,8 @@
 VERSION="0.9.14"
 OUT="$1"
 
+echo '#include "iw.h"' > "$OUT"
+
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
        git update-index --refresh --unmerged > /dev/null
        descr=$(git describe)
@@ -11,7 +13,6 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
        # is correct...
        [ "${descr%%-*}" = "v$VERSION" ] || exit 2
 
-       echo -n 'const char iw_version[] = "' > "$OUT"
        v="${descr#v}"
        if git diff-index --name-only HEAD | read dummy ; then
                v="$v"-dirty
@@ -20,4 +21,4 @@ else
        v="$VERSION"
 fi
 
-echo "const char iw_version[] = \"$v\";" > "$OUT"
+echo "const char iw_version[] = \"$v\";" >> "$OUT"