Message ID | 1508418579-10679-1-git-send-email-marcelo.cerri@canonical.com |
---|---|
State | New |
Headers | show |
Series | [kteam-tools] verify-release-ready: ignore the parent changelog when checking derivative kernels | expand |
Hi, Kamal.
The script looks perfectly fine for me. But is there a particular use or
motivation for it?
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
I replied to the wrong email.
On 10/19/17 15:09, Marcelo Henrique Cerri wrote: > Parse the derivative own bugs and changelog in separate and use that > when checking the state of each bug and searching for miscellaneous > entries instead. > > Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> > --- > ktl/debian.py | 17 +++++++++++++++++ > maintscripts/verify-release-ready | 4 ++-- > 2 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/ktl/debian.py b/ktl/debian.py > index ef530d2651fd..230741235974 100644 > --- a/ktl/debian.py > +++ b/ktl/debian.py > @@ -52,6 +52,8 @@ class Debian: > bug_rc = compile("LP:\s*#[0-9]+(?:\s*,\s*#[0-9]+)*") > bug_nr_rc = compile("#([0-9]+)") > > + parent_bug_section_rc = compile("^\s*\[ Ubuntu: .*\]") > + > # debian_directories > # > @classmethod > @@ -154,7 +156,10 @@ class Debian: > raise DebianError("The first line in the changelog is not a version line.") > > content = [] > + own_content = [] > bugs = [] > + own_bugs = [] > + parsing_own_bugs = True > > for line in changelog_contents: > m = cls.version_line_rc.match(line) > @@ -176,8 +181,10 @@ class Debian: > section['series'] = release > section['pocket'] = pocket > section['content'] = content > + section['own-content'] = own_content > section['package'] = package > section['bugs'] = set(bugs) > + section['own-bugs'] = set(own_bugs) > > m = cls.version_rc.match(version) > if m is not None: > @@ -189,14 +196,24 @@ class Debian: > > retval.append(section) > content = [] > + own_content = [] > bugs = [] > + own_bugs = [] > + parsing_own_bugs = True > else: > + if cls.parent_bug_section_rc.match(line): > + parsing_own_bugs = False > + > # find bug numbers and append them to the list > for bug_line_match in finditer(cls.bug_rc, line): > bug_matches = findall(cls.bug_nr_rc, bug_line_match.group(0)) > bugs.extend(bug_matches) > + if parsing_own_bugs: > + own_bugs.extend(bug_matches) > > content.append(line) > + if parsing_own_bugs: > + own_content.append(line) > > return retval > > diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready > index 8530b44c0623..e0dbfe68b049 100755 > --- a/maintscripts/verify-release-ready > +++ b/maintscripts/verify-release-ready > @@ -328,7 +328,7 @@ class VerifyReleaseReady(): > # entries were inserted by debian/scripts/misc/git-ubuntu-log > msg = 'no "Miscellaneous" entries' > changelog = Debian.changelog() > - content = changelog[1]['content'] > + content = changelog[1]['own-content'] > for line in content: > m = re.match("\* Miscellaneous .* changes$", line.strip()) > if m: > @@ -339,7 +339,7 @@ class VerifyReleaseReady(): > > def verify_changelog_bugs(s): > changelog = Debian.changelog() > - changelog_bugs = changelog[1]['bugs'] > + changelog_bugs = changelog[1]['own-bugs'] > changelog_series = changelog[1]['series'] > changelog_source_package = changelog[1]['package'] > >
On Thu, Oct 19, 2017 at 11:09:39AM -0200, Marcelo Henrique Cerri wrote: > Parse the derivative own bugs and changelog in separate and use that > when checking the state of each bug and searching for miscellaneous > entries instead. > > Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> > --- The idea is good and simple. I don't think we need to complicate it and match the other bugs with the ones in master. So: Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Also, I tested it with Ubuntu-raspi2-4.4.0-1076.84, and it works great. Tested-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> > ktl/debian.py | 17 +++++++++++++++++ > maintscripts/verify-release-ready | 4 ++-- > 2 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/ktl/debian.py b/ktl/debian.py > index ef530d2651fd..230741235974 100644 > --- a/ktl/debian.py > +++ b/ktl/debian.py > @@ -52,6 +52,8 @@ class Debian: > bug_rc = compile("LP:\s*#[0-9]+(?:\s*,\s*#[0-9]+)*") > bug_nr_rc = compile("#([0-9]+)") > > + parent_bug_section_rc = compile("^\s*\[ Ubuntu: .*\]") > + > # debian_directories > # > @classmethod > @@ -154,7 +156,10 @@ class Debian: > raise DebianError("The first line in the changelog is not a version line.") > > content = [] > + own_content = [] > bugs = [] > + own_bugs = [] > + parsing_own_bugs = True > > for line in changelog_contents: > m = cls.version_line_rc.match(line) > @@ -176,8 +181,10 @@ class Debian: > section['series'] = release > section['pocket'] = pocket > section['content'] = content > + section['own-content'] = own_content > section['package'] = package > section['bugs'] = set(bugs) > + section['own-bugs'] = set(own_bugs) > > m = cls.version_rc.match(version) > if m is not None: > @@ -189,14 +196,24 @@ class Debian: > > retval.append(section) > content = [] > + own_content = [] > bugs = [] > + own_bugs = [] > + parsing_own_bugs = True > else: > + if cls.parent_bug_section_rc.match(line): > + parsing_own_bugs = False > + > # find bug numbers and append them to the list > for bug_line_match in finditer(cls.bug_rc, line): > bug_matches = findall(cls.bug_nr_rc, bug_line_match.group(0)) > bugs.extend(bug_matches) > + if parsing_own_bugs: > + own_bugs.extend(bug_matches) > > content.append(line) > + if parsing_own_bugs: > + own_content.append(line) > > return retval > > diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready > index 8530b44c0623..e0dbfe68b049 100755 > --- a/maintscripts/verify-release-ready > +++ b/maintscripts/verify-release-ready > @@ -328,7 +328,7 @@ class VerifyReleaseReady(): > # entries were inserted by debian/scripts/misc/git-ubuntu-log > msg = 'no "Miscellaneous" entries' > changelog = Debian.changelog() > - content = changelog[1]['content'] > + content = changelog[1]['own-content'] > for line in content: > m = re.match("\* Miscellaneous .* changes$", line.strip()) > if m: > @@ -339,7 +339,7 @@ class VerifyReleaseReady(): > > def verify_changelog_bugs(s): > changelog = Debian.changelog() > - changelog_bugs = changelog[1]['bugs'] > + changelog_bugs = changelog[1]['own-bugs'] > changelog_series = changelog[1]['series'] > changelog_source_package = changelog[1]['package'] > > -- > 2.7.4 > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff --git a/ktl/debian.py b/ktl/debian.py index ef530d2651fd..230741235974 100644 --- a/ktl/debian.py +++ b/ktl/debian.py @@ -52,6 +52,8 @@ class Debian: bug_rc = compile("LP:\s*#[0-9]+(?:\s*,\s*#[0-9]+)*") bug_nr_rc = compile("#([0-9]+)") + parent_bug_section_rc = compile("^\s*\[ Ubuntu: .*\]") + # debian_directories # @classmethod @@ -154,7 +156,10 @@ class Debian: raise DebianError("The first line in the changelog is not a version line.") content = [] + own_content = [] bugs = [] + own_bugs = [] + parsing_own_bugs = True for line in changelog_contents: m = cls.version_line_rc.match(line) @@ -176,8 +181,10 @@ class Debian: section['series'] = release section['pocket'] = pocket section['content'] = content + section['own-content'] = own_content section['package'] = package section['bugs'] = set(bugs) + section['own-bugs'] = set(own_bugs) m = cls.version_rc.match(version) if m is not None: @@ -189,14 +196,24 @@ class Debian: retval.append(section) content = [] + own_content = [] bugs = [] + own_bugs = [] + parsing_own_bugs = True else: + if cls.parent_bug_section_rc.match(line): + parsing_own_bugs = False + # find bug numbers and append them to the list for bug_line_match in finditer(cls.bug_rc, line): bug_matches = findall(cls.bug_nr_rc, bug_line_match.group(0)) bugs.extend(bug_matches) + if parsing_own_bugs: + own_bugs.extend(bug_matches) content.append(line) + if parsing_own_bugs: + own_content.append(line) return retval diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready index 8530b44c0623..e0dbfe68b049 100755 --- a/maintscripts/verify-release-ready +++ b/maintscripts/verify-release-ready @@ -328,7 +328,7 @@ class VerifyReleaseReady(): # entries were inserted by debian/scripts/misc/git-ubuntu-log msg = 'no "Miscellaneous" entries' changelog = Debian.changelog() - content = changelog[1]['content'] + content = changelog[1]['own-content'] for line in content: m = re.match("\* Miscellaneous .* changes$", line.strip()) if m: @@ -339,7 +339,7 @@ class VerifyReleaseReady(): def verify_changelog_bugs(s): changelog = Debian.changelog() - changelog_bugs = changelog[1]['bugs'] + changelog_bugs = changelog[1]['own-bugs'] changelog_series = changelog[1]['series'] changelog_source_package = changelog[1]['package']
Parse the derivative own bugs and changelog in separate and use that when checking the state of each bug and searching for miscellaneous entries instead. Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> --- ktl/debian.py | 17 +++++++++++++++++ maintscripts/verify-release-ready | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-)