Skip to content

Commit 31853a1

Browse files
committed
Merge pull request #4049
3d20cd5 VERSION obtained from source instead of the previous git tag. (Warren Togami)
2 parents 74dd52a + 3d20cd5 commit 31853a1

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Bitcoin 0.9.0 BETA
1+
Bitcoin 0.9.99 BETA
22
=====================
33

44
Copyright (c) 2009-2014 Bitcoin Developers

doc/README_windows.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Bitcoin 0.9.0rc1 BETA
1+
Bitcoin 0.9.99 BETA
22

33
Copyright (c) 2009-2014 Bitcoin Core Developers
44

doc/release-process.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Release Process
88

99
###update (commit) version in sources
1010

11-
12-
bitcoin-qt.pro
1311
contrib/verifysfbinaries/verify.sh
1412
doc/README*
1513
share/setup.nsi

share/genbuild.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,30 @@ else
1414
fi
1515

1616
DESC=""
17+
SUFFIX=""
1718
LAST_COMMIT_DATE=""
1819
if [ -e "$(which git)" -a -d ".git" ]; then
1920
# clean 'dirty' status of touched files that haven't been modified
2021
git diff >/dev/null 2>/dev/null
2122

22-
# get a string like "v0.6.0-66-g59887e8-dirty"
23-
DESC="$(git describe --dirty 2>/dev/null)"
23+
# if latest commit is tagged and not dirty, then override using the tag name
24+
RAWDESC=$(git describe --abbrev=0 2>/dev/null)
25+
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC)" ]; then
26+
git diff-index --quiet HEAD -- && DESC=$RAWDESC
27+
fi
28+
29+
# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
30+
SUFFIX=$(git rev-parse --short HEAD)
31+
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
2432

2533
# get a string like "2012-04-10 16:27:19 +0200"
2634
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
2735
fi
2836

2937
if [ -n "$DESC" ]; then
3038
NEWINFO="#define BUILD_DESC \"$DESC\""
39+
elif [ -n "$SUFFIX" ]; then
40+
NEWINFO="#define BUILD_SUFFIX $SUFFIX"
3141
else
3242
NEWINFO="// No build information available"
3343
fi

src/clientversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
1212
#define CLIENT_VERSION_MAJOR 0
1313
#define CLIENT_VERSION_MINOR 9
14-
#define CLIENT_VERSION_REVISION 0
15-
#define CLIENT_VERSION_BUILD 99
14+
#define CLIENT_VERSION_REVISION 99
15+
#define CLIENT_VERSION_BUILD 0
1616

1717
// Set to true for release, false for prerelease or test build
1818
#define CLIENT_VERSION_IS_RELEASE false

src/version.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ const std::string CLIENT_NAME("Satoshi");
4040
# define GIT_COMMIT_DATE "$Format:%cD$"
4141
#endif
4242

43+
#define BUILD_DESC_WITH_SUFFIX(maj,min,rev,build,suffix) \
44+
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix)
45+
4346
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
4447
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit
4548

4649
#define BUILD_DESC_FROM_UNKNOWN(maj,min,rev,build) \
4750
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"
4851

4952
#ifndef BUILD_DESC
50-
# ifdef GIT_COMMIT_ID
53+
# ifdef BUILD_SUFFIX
54+
# define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX)
55+
# elif defined(GIT_COMMIT_ID)
5156
# define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID)
5257
# else
5358
# define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD)

0 commit comments

Comments
 (0)