diff mbox series

[SRU,J] UBUNTU: [Packaging] config-check: Handle new annotations format 4

Message ID 20230531094202.323914-1-juerg.haefliger@canonical.com
State New
Headers show
Series [SRU,J] UBUNTU: [Packaging] config-check: Handle new annotations format 4 | expand

Commit Message

Juerg Haefliger May 31, 2023, 9:42 a.m. UTC
For derivatives, we could end up in a situation where the master has
already switched over to the new annotations format 4 but the derivative
still wants to use the old scheme. In that case, the config-check script
is still used and needs to properly handle the new annotations format 4
(in case the derivative includes the annotations from the master).

Ignore: yes
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
---
 debian/scripts/config-check | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andrea Righi May 31, 2023, 10:03 a.m. UTC | #1
On Wed, May 31, 2023 at 11:42:02AM +0200, Juerg Haefliger wrote:
> For derivatives, we could end up in a situation where the master has
> already switched over to the new annotations format 4 but the derivative
> still wants to use the old scheme. In that case, the config-check script
> is still used and needs to properly handle the new annotations format 4
> (in case the derivative includes the annotations from the master).
> 
> Ignore: yes
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>

Looks good to me. Thanks for fixing this!

Acked-by: Andrea Righi <andrea.righi@canonical.com>

> ---
>  debian/scripts/config-check | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/debian/scripts/config-check b/debian/scripts/config-check
> index df0cd52069b4..6e64277da00b 100755
> --- a/debian/scripts/config-check
> +++ b/debian/scripts/config-check
> @@ -58,12 +58,12 @@ sub read_annotations {
>  	die "$P: $filename: open failed -- $! -- aborting\n";
>      while (<$fd>) {
>  	if (/^# FORMAT: (\S+)/) {
> -	    die "$P: $1: unknown annotations format\n" if ($1 != 2 && $1 != 3);
> +	    die "$P: $1: unknown annotations format\n" if ($1 < 2 || $1 > 4);
>  	    $form = $1;
>  	}
>  
> -	# Format #3 adds the include directive on top of format #2:
> -	if ($form == 3 && /^\s*include(\s|$)/) {
> +	# Format #3 and #4 add the include directive on top of format #2:
> +	if ($form >= 3 && /^\s*include(\s|$)/) {
>  	    # Include quoted or unquoted files:
>  	    if (/^\s*include\s+"(.*)"\s*$/ || /^\s*include\s+(.*)$/) {
>  		# The include is relative to the current file
> -- 
> 2.37.2
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Andrei Gherzan May 31, 2023, 12:02 p.m. UTC | #2
On 23/05/31 11:42AM, Juerg Haefliger wrote:
> For derivatives, we could end up in a situation where the master has
> already switched over to the new annotations format 4 but the derivative
> still wants to use the old scheme. In that case, the config-check script
> is still used and needs to properly handle the new annotations format 4
> (in case the derivative includes the annotations from the master).
> 
> Ignore: yes
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  debian/scripts/config-check | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/debian/scripts/config-check b/debian/scripts/config-check
> index df0cd52069b4..6e64277da00b 100755
> --- a/debian/scripts/config-check
> +++ b/debian/scripts/config-check
> @@ -58,12 +58,12 @@ sub read_annotations {
>  	die "$P: $filename: open failed -- $! -- aborting\n";
>      while (<$fd>) {
>  	if (/^# FORMAT: (\S+)/) {
> -	    die "$P: $1: unknown annotations format\n" if ($1 != 2 && $1 != 3);
> +	    die "$P: $1: unknown annotations format\n" if ($1 < 2 || $1 > 4);
>  	    $form = $1;
>  	}
>  
> -	# Format #3 adds the include directive on top of format #2:
> -	if ($form == 3 && /^\s*include(\s|$)/) {
> +	# Format #3 and #4 add the include directive on top of format #2:
> +	if ($form >= 3 && /^\s*include(\s|$)/) {
>  	    # Include quoted or unquoted files:
>  	    if (/^\s*include\s+"(.*)"\s*$/ || /^\s*include\s+(.*)$/) {
>  		# The include is relative to the current file
> -- 
> 2.37.2

Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Tim Gardner May 31, 2023, 3:14 p.m. UTC | #3
On 5/31/23 3:42 AM, Juerg Haefliger wrote:
> For derivatives, we could end up in a situation where the master has
> already switched over to the new annotations format 4 but the derivative
> still wants to use the old scheme. In that case, the config-check script
> is still used and needs to properly handle the new annotations format 4
> (in case the derivative includes the annotations from the master).
> 
> Ignore: yes
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>   debian/scripts/config-check | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/debian/scripts/config-check b/debian/scripts/config-check
> index df0cd52069b4..6e64277da00b 100755
> --- a/debian/scripts/config-check
> +++ b/debian/scripts/config-check
> @@ -58,12 +58,12 @@ sub read_annotations {
>   	die "$P: $filename: open failed -- $! -- aborting\n";
>       while (<$fd>) {
>   	if (/^# FORMAT: (\S+)/) {
> -	    die "$P: $1: unknown annotations format\n" if ($1 != 2 && $1 != 3);
> +	    die "$P: $1: unknown annotations format\n" if ($1 < 2 || $1 > 4);
>   	    $form = $1;
>   	}
>   
> -	# Format #3 adds the include directive on top of format #2:
> -	if ($form == 3 && /^\s*include(\s|$)/) {
> +	# Format #3 and #4 add the include directive on top of format #2:
> +	if ($form >= 3 && /^\s*include(\s|$)/) {
>   	    # Include quoted or unquoted files:
>   	    if (/^\s*include\s+"(.*)"\s*$/ || /^\s*include\s+(.*)$/) {
>   		# The include is relative to the current file
Applied to jammy/linux:master-next. Thanks.

-rtg
diff mbox series

Patch

diff --git a/debian/scripts/config-check b/debian/scripts/config-check
index df0cd52069b4..6e64277da00b 100755
--- a/debian/scripts/config-check
+++ b/debian/scripts/config-check
@@ -58,12 +58,12 @@  sub read_annotations {
 	die "$P: $filename: open failed -- $! -- aborting\n";
     while (<$fd>) {
 	if (/^# FORMAT: (\S+)/) {
-	    die "$P: $1: unknown annotations format\n" if ($1 != 2 && $1 != 3);
+	    die "$P: $1: unknown annotations format\n" if ($1 < 2 || $1 > 4);
 	    $form = $1;
 	}
 
-	# Format #3 adds the include directive on top of format #2:
-	if ($form == 3 && /^\s*include(\s|$)/) {
+	# Format #3 and #4 add the include directive on top of format #2:
+	if ($form >= 3 && /^\s*include(\s|$)/) {
 	    # Include quoted or unquoted files:
 	    if (/^\s*include\s+"(.*)"\s*$/ || /^\s*include\s+(.*)$/) {
 		# The include is relative to the current file