mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 13:27:36 +00:00
Determine the version and release from code/version.c.
Copied from Perforce Change: 181456 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
3365c939b3
commit
577e0eb569
1 changed files with 7 additions and 15 deletions
|
|
@ -50,21 +50,13 @@
|
|||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
_project_filespec = '//info.ravenbrook.com/project/mps'
|
||||
_m = re.search(r'/version/\([0-9]+\.[0-9]+\)/', os.path.abspath(__file__))
|
||||
if _m:
|
||||
version = _m.group(1)
|
||||
else:
|
||||
# Next version.
|
||||
_versions_filespec = '{}/version/*'.format(_project_filespec)
|
||||
_versions = check_output(['p4', 'dirs', _versions_filespec]).splitlines()
|
||||
_version = [int(v) for v in _versions[-1].split('/')[-1].split('.')]
|
||||
_version[-1] += 1
|
||||
version = '.'.join(map(str, _version))
|
||||
_releases_filespec = '{}/release/{}.*'.format(_project_filespec, version)
|
||||
_releases = check_output(['p4', 'dirs', _releases_filespec]).splitlines()
|
||||
_release_n = max(int(r.split('.')[-1]) for r in _releases) if _releases else 0
|
||||
release = '{}.{}'.format(version, _release_n)
|
||||
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||
'../../code/version.c')) as f:
|
||||
for line in f:
|
||||
m = re.match(r'#define MPS_RELEASE "release/((\d+\.\d+)\.\d+)"', line)
|
||||
if m:
|
||||
release, version = m.groups()
|
||||
break
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
|||
Loading…
Reference in a new issue