]>
jfr.im git - irc/evilnet/znc.git/blob - version.sh
3 # When changing this file, remember also about nightlies (make-tarball.sh)
5 # Get the path to the source directory
8 # Our argument should be the path to git
15 GIT
="${GIT} --git-dir=${GIT_DIR}/.git"
17 # Figure out the information we need
18 LATEST_TAG
=`${GIT} describe --abbrev=0 HEAD`
19 COMMITS_SINCE
=`${GIT} log --pretty=oneline ${LATEST_TAG}..HEAD | wc -l`
20 # Explicitly make it a number: on openbsd wc -l returns " 42" instead of "42"
21 let COMMITS_SINCE
=COMMITS_SINCE
22 SHORT_ID
=`${GIT} rev-parse --short HEAD`
24 if [ "x$COMMITS_SINCE" = "x0" ]
26 if [ "x$LATEST_TAG" = "x" ]
28 if [ "x$SHORT_ID" = "x" ]
32 EXTRA
="-git-${SHORT_ID}"
35 # If this commit is tagged, don't print anything
36 # (the assumption here is: this is a release)
40 EXTRA
="-git-${COMMITS_SINCE}-${SHORT_ID}"
43 if [ 1 = `cd ${GIT_DIR}; ${GIT_HERE} status --ignore-submodules=dirty --porcelain -- third_party/Csocket | wc -l` ]
45 # Makefile redirects all errors from this script into /dev/null, but this messages actually needs to be shown
46 # So put it to 3, and then Makefile redirects 3 to stderr
47 echo "Warning: Csocket submodule looks outdated. Run: git submodule update --init --recursive" 1>&3
48 EXTRA
="${EXTRA}-frankenznc"
52 # Generate output file, if any
53 if [ "x$WRITE_OUTPUT" = "xyes" ]
55 echo '#include <znc/version.h>' > src
/version.cpp
56 echo "const char* ZNC_VERSION_EXTRA = VERSION_EXTRA \"$EXTRA\";" >> src
/version.cpp