forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
SOURCE_DIR=$1 | ||
MAJOR=$2 | ||
MINOR=$3 | ||
PATCH=$4 | ||
|
||
VER="$MAJOR.$MINOR.$PATCH" | ||
|
||
update() { | ||
file="$SOURCE_DIR/$1" | ||
expr="$2" | ||
|
||
sed -e "$expr" "$file" > "$file.updated-version" | ||
if diff "$file" "$file.updated-version"; then | ||
rm "$file.updated-version" | ||
else | ||
mv "$file.updated-version" "$file" | ||
fi | ||
} | ||
|
||
update "configure.ac" 's/AC_INIT(\[tox\], \[.*\])/AC_INIT([tox], ['$VER'])/' | ||
|
||
update "other/apidsl/tox.in.h" 's/\(const VERSION_MAJOR *= \).*;/\1'$MAJOR';/' | ||
update "other/apidsl/tox.in.h" 's/\(const VERSION_MINOR *= \).*;/\1'$MINOR';/' | ||
update "other/apidsl/tox.in.h" 's/\(const VERSION_PATCH *= \).*;/\1'$PATCH';/' |