diff options
author | Amitay Isaacs <amitay@gmail.com> | 2015-10-23 13:05:20 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2015-10-30 02:00:27 +0100 |
commit | ded94c426b2e7758735a57ec2b5c7c62a1b4fc65 (patch) | |
tree | a90a6c2bbadcffc785f0950fd332fcca57042037 /ctdb/packaging | |
parent | f50ac680340ad2981ffac2b7ac0e2c746a17882c (diff) | |
download | samba-ded94c426b2e7758735a57ec2b5c7c62a1b4fc65.tar.gz |
ctdb-build: Calculate correct version when building from tarball
When building standalone ctdb from git repo, samba_version_file correctly
includes git sha in VERSION string. When building standalone ctdb from
tarball, samba_version_file puts UNKNOWN in the VERSION string.
Use the packaged include/ctdb_version.h file to set the correct git sha.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/packaging')
-rwxr-xr-x | ctdb/packaging/mkversion.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ctdb/packaging/mkversion.sh b/ctdb/packaging/mkversion.sh index e4a37adb654..54dc2cd15fa 100755 --- a/ctdb/packaging/mkversion.sh +++ b/ctdb/packaging/mkversion.sh @@ -61,10 +61,21 @@ case "$TAG" in ;; esac +else + + # If building from tarball, Samba version creation will create + # VERSION with UNKNOWN git hash. + case "$VERSION" in + *UNKNOWN) + if [ -f ../include/ctdb_version.h ] ; then + VERSION=$(awk -F \" '/CTDB_VERSION_STRING/ {print $2}' ../include/ctdb_version.h) + fi + ;; + esac fi cat > "$OUTPUT" <<EOF -/* This file is auto-genrated by packaging/mkversion.sh */ +/* This file is auto-generated by packaging/mkversion.sh */ #define CTDB_VERSION_STRING "$VERSION" |