]>
git.ipfire.org Git - thirdparty/iw.git/blob - version.sh
6 # get the absolute path for the OUT file
7 OUT_NAME
=$
(basename ${OUT})
8 OUT_DIR
=$
(cd $
(dirname ${OUT}); pwd)
9 OUT
="${OUT_DIR}/${OUT_NAME}"
11 # the version check should be under the source directory
12 # where this script is located, instead of the currect directory
13 # where this script is excuted.
15 SRC_DIR
=$
(cd ${SRC_DIR}; pwd)
19 if [ -d .git
] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
20 git update-index
--refresh --unmerged > /dev
/null
21 descr
=$
(git describe
--match=v
* 2>/dev
/null
)
23 # on git builds check that the version number above
25 if [ "${descr%%-*}" = "v$VERSION" ]; then
27 if git diff-index
--name-only HEAD |
read dummy
; then
34 # set to the default version when failed to get the version
35 # information with git
36 if [ -z "${v}" ]; then
40 echo '#include "iw.h"' > "$OUT"
41 echo "const char iw_version[] = \"$v\";" >> "$OUT"