version: add ability to specify a version suffix
This commit is contained in:
parent
1cc5f179f5
commit
f70b3fae8b
@ -29,7 +29,9 @@ def get_libuv_version():
|
||||
patch = int(m.group(1))
|
||||
m = re.search(r"""^#define UV_VERSION_IS_RELEASE (\d)$""", data, re.MULTILINE)
|
||||
is_release = int(m.group(1))
|
||||
return '%d.%d.%d%s' % (major, minor, patch, '-pre' if not is_release else '')
|
||||
m = re.search(r"""^#define UV_VERSION_SUFFIX \"(\w*)\"$""", data, re.MULTILINE)
|
||||
suffix = m.group(1)
|
||||
return '%d.%d.%d%s' % (major, minor, patch, '-%s' % suffix if not is_release else '')
|
||||
except Exception:
|
||||
return 'unknown'
|
||||
|
||||
|
||||
@ -34,5 +34,6 @@
|
||||
#define UV_VERSION_MINOR 0
|
||||
#define UV_VERSION_PATCH 0
|
||||
#define UV_VERSION_IS_RELEASE 0
|
||||
#define UV_VERSION_SUFFIX "dev"
|
||||
|
||||
#endif /* UV_VERSION_H */
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#if UV_VERSION_IS_RELEASE
|
||||
# define UV_VERSION_STRING UV_VERSION_STRING_BASE
|
||||
#else
|
||||
# define UV_VERSION_STRING UV_VERSION_STRING_BASE "-pre"
|
||||
# define UV_VERSION_STRING UV_VERSION_STRING_BASE "-" UV_VERSION_SUFFIX
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user