diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-23 23:34:16 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-28 23:29:36 +0100 |
commit | 36f40f1a4f9041c138cc38460cb8e93d904131bd (patch) | |
tree | 87ce5cc8528337ca75a82402fe61d154c6b66aff /other/version-sync | |
parent | 51139a080c982a6460aa25975b3a1e0866f518ed (diff) |
Add version-sync script to update all places with versions.
This will update tox.in.h only. Currently, you will still need to
manually update tox.h. An upcoming PR (#154) will update tox.h as
part of the build.
Diffstat (limited to 'other/version-sync')
-rwxr-xr-x | other/version-sync | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/other/version-sync b/other/version-sync new file mode 100755 index 00000000..642e8177 --- /dev/null +++ b/other/version-sync | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | SOURCE_DIR=$1 | ||
6 | MAJOR=$2 | ||
7 | MINOR=$3 | ||
8 | PATCH=$4 | ||
9 | |||
10 | VER="$MAJOR.$MINOR.$PATCH" | ||
11 | |||
12 | update() { | ||
13 | file="$SOURCE_DIR/$1" | ||
14 | expr="$2" | ||
15 | |||
16 | sed -e "$expr" "$file" > "$file.updated-version" | ||
17 | if diff "$file" "$file.updated-version"; then | ||
18 | rm "$file.updated-version" | ||
19 | else | ||
20 | mv "$file.updated-version" "$file" | ||
21 | fi | ||
22 | } | ||
23 | |||
24 | update "configure.ac" 's/AC_INIT(\[tox\], \[.*\])/AC_INIT([tox], ['$VER'])/' | ||
25 | |||
26 | update "other/apidsl/tox.in.h" 's/\(const VERSION_MAJOR *= \).*;/\1'$MAJOR';/' | ||
27 | update "other/apidsl/tox.in.h" 's/\(const VERSION_MINOR *= \).*;/\1'$MINOR';/' | ||
28 | update "other/apidsl/tox.in.h" 's/\(const VERSION_PATCH *= \).*;/\1'$PATCH';/' | ||