mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00:00
Merge pull request #8550 from gabor-mezei-arm/tf_psa_crypto_change_log_support
Modify changelog assembly to work with tf-psa-crypto
This commit is contained in:
commit
42d78c73b7
@ -115,7 +115,7 @@ class ChangelogFormat:
|
|||||||
class TextChangelogFormat(ChangelogFormat):
|
class TextChangelogFormat(ChangelogFormat):
|
||||||
"""The traditional Mbed TLS changelog format."""
|
"""The traditional Mbed TLS changelog format."""
|
||||||
|
|
||||||
_unreleased_version_text = '= Mbed TLS x.x.x branch released xxxx-xx-xx'
|
_unreleased_version_text = '= {} x.x.x branch released xxxx-xx-xx'
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_released_version(cls, title):
|
def is_released_version(cls, title):
|
||||||
# Look for an incomplete release date
|
# Look for an incomplete release date
|
||||||
@ -123,6 +123,7 @@ class TextChangelogFormat(ChangelogFormat):
|
|||||||
|
|
||||||
_top_version_re = re.compile(r'(?:\A|\n)(=[^\n]*\n+)(.*?\n)(?:=|$)',
|
_top_version_re = re.compile(r'(?:\A|\n)(=[^\n]*\n+)(.*?\n)(?:=|$)',
|
||||||
re.DOTALL)
|
re.DOTALL)
|
||||||
|
_name_re = re.compile(r'=\s(.*)\s[0-9x]+\.', re.DOTALL)
|
||||||
@classmethod
|
@classmethod
|
||||||
def extract_top_version(cls, changelog_file_content):
|
def extract_top_version(cls, changelog_file_content):
|
||||||
"""A version section starts with a line starting with '='."""
|
"""A version section starts with a line starting with '='."""
|
||||||
@ -131,9 +132,10 @@ class TextChangelogFormat(ChangelogFormat):
|
|||||||
top_version_end = m.end(2)
|
top_version_end = m.end(2)
|
||||||
top_version_title = m.group(1)
|
top_version_title = m.group(1)
|
||||||
top_version_body = m.group(2)
|
top_version_body = m.group(2)
|
||||||
|
name = re.match(cls._name_re, top_version_title).group(1)
|
||||||
if cls.is_released_version(top_version_title):
|
if cls.is_released_version(top_version_title):
|
||||||
top_version_end = top_version_start
|
top_version_end = top_version_start
|
||||||
top_version_title = cls._unreleased_version_text + '\n\n'
|
top_version_title = cls._unreleased_version_text.format(name) + '\n\n'
|
||||||
top_version_body = ''
|
top_version_body = ''
|
||||||
return (changelog_file_content[:top_version_start],
|
return (changelog_file_content[:top_version_start],
|
||||||
top_version_title, top_version_body,
|
top_version_title, top_version_body,
|
||||||
@ -245,6 +247,7 @@ class ChangeLog:
|
|||||||
for category in STANDARD_CATEGORIES:
|
for category in STANDARD_CATEGORIES:
|
||||||
self.categories[category] = ''
|
self.categories[category] = ''
|
||||||
offset = (self.header + self.top_version_title).count('\n') + 1
|
offset = (self.header + self.top_version_title).count('\n') + 1
|
||||||
|
|
||||||
self.add_categories_from_text(input_stream.name, offset,
|
self.add_categories_from_text(input_stream.name, offset,
|
||||||
top_version_body, True)
|
top_version_body, True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user