Automatically generated ChangeLog files - script

Martin Liška mliska@suse.cz
Tue Jul 7 07:08:00 GMT 2020


On 7/7/20 4:14 AM, Alexandre Oliva wrote:
> Sorry it took me so long to get back to this.

Don't worry!

> 
> On Jun 24, 2020, Martin Liška <mliska@suse.cz> wrote:
> 
>> Please escape the '[':
>> +end_of_location_regex = re.compile(r'[\[<(:]')
> 
> check
> 
>> and please a test-case for it.
> 
> check
> 
> Thanks, I've made the changes; sorry it took me so long.
> 
> I couldn't figure out how to run the internal gcc-changelog test.

I've just installed your patch and added the test, please see the change
in test_email.py in:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a759bfc7cf238b9fc5bf97884297fc69d8cdf2b5

Thank you for the patch,
Martin

> 
> 
> accept <case> and [cond] in ChangeLog
> 
> From: Alexandre Oliva <oliva@adacore.com>
> 
> Only '(' and ':' currently terminate file lists in ChangeLog entries
> in the ChangeLog parser.  This rules out such legitimate entries as:
> 
> 	* filename <CASE>:
> 	* filename [COND]:
> 
> This patch extends the ChangeLog parser to recognize these forms.
> 
> 
> for  contrib/ChangeLog
> 
> 	* gcc-changelog/git_commit.py: Support CASE and COND.
> 	* gcc-changelog/test_patches.txt: Add test.
> ---
>   contrib/gcc-changelog/git_commit.py    |   16 +++++++--------
>   contrib/gcc-changelog/test_patches.txt |   35 ++++++++++++++++++++++++++++++++
>   2 files changed, 43 insertions(+), 8 deletions(-)
> 
> diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
> index 4a78793..900a294 100755
> --- a/contrib/gcc-changelog/git_commit.py
> +++ b/contrib/gcc-changelog/git_commit.py
> @@ -154,6 +154,7 @@ changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
>   pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?([0-9]+)$')
>   dr_regex = re.compile(r'\tDR ([0-9]+)$')
>   star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
> +end_of_location_regex = re.compile(r'[\[<(:]')
>   
>   LINE_LIMIT = 100
>   TAB_WIDTH = 8
> @@ -203,14 +204,13 @@ class ChangeLogEntry:
>                   line = m.group('content')
>   
>               if in_location:
> -                # Strip everything that is not a filename in "line": entities
> -                # "(NAME)", entry text (the colon, if present, and anything
> -                # that follows it).
> -                if '(' in line:
> -                    line = line[:line.index('(')]
> -                    in_location = False
> -                if ':' in line:
> -                    line = line[:line.index(':')]
> +                # Strip everything that is not a filename in "line":
> +                # entities "(NAME)", cases "<PATTERN>", conditions
> +                # "[COND]", entry text (the colon, if present, and
> +                # anything that follows it).
> +                m = end_of_location_regex.search(line)
> +                if m:
> +                    line = line[:m.start()]
>                       in_location = False
>   
>                   # At this point, all that's left is a list of filenames
> diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
> index 1463fb9..2bf5d1a 100644
> --- a/contrib/gcc-changelog/test_patches.txt
> +++ b/contrib/gcc-changelog/test_patches.txt
> @@ -3160,3 +3160,38 @@ index 823eb539993..4ec22162c12 100644
>   --
>   2.27.0
>   
> +=== 0001-Check-for-more-missing-math-decls-on-vxworks.patch ===
> +From 0edfc1fd22405ee8e946101e44cd8edc0ee12047 Mon Sep 17 00:00:00 2001
> +From: Douglas B Rupp <douglas.b.rupp@gmail.com>
> +Date: Sun, 31 May 2020 13:25:28 -0700
> +Subject: [PATCH] Check for more missing math decls on vxworks.
> +
> +Use the GLIBCXX_CHECK_MATH_DECL macro to check for the full list of
> +vxworks math decls.
> +
> +for libstdc++-v3/ChangeLog:
> +
> +	* crossconfig.m4 <*-vxworks>: Check for more math decls.
> +	* configure [FAKEPATCH]: Rebuild.
> +---
> + libstdc++-v3/configure      | 255 ++++++++++++++++++++++++++++++++++++++++++++
> + libstdc++-v3/crossconfig.m4 |   3 +-
> + 2 files changed, 257 insertions(+), 1 deletion(-)
> +
> +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
> +index b5beb45..4ef678e 100755
> +--- a/libstdc++-v3/configure
> ++++ b/libstdc++-v3/configure
> +@@ -1 +1,2 @@
> +
> ++
> +diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
> +index fe18288..313f84d 100644
> +--- a/libstdc++-v3/crossconfig.m4
> ++++ b/libstdc++-v3/crossconfig.m4
> +@@ -1 +1,2 @@
> +
> ++
> +--
> +2.7.4
> +
> 
> 



More information about the Gcc mailing list