From: Johannes Berg Date: Thu, 2 Jul 2009 07:09:13 +0000 (+0200) Subject: fix version script to include header and not write file twice X-Git-Tag: v0.9.15~11^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69f0caab2362a84b07513536500079753b0de6c8;p=thirdparty%2Fiw.git fix version script to include header and not write file twice --- diff --git a/version.sh b/version.sh index 63c1e0d..74f852e 100755 --- a/version.sh +++ b/version.sh @@ -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"