chiark / gitweb /
check_tree.pl: Fixed unprepare_xml()
authorSven Eden <yamakuzure@gmx.net>
Thu, 17 May 2018 18:01:49 +0000 (20:01 +0200)
committerSven Eden <yamakuzure@gmx.net>
Thu, 24 May 2018 16:50:09 +0000 (18:50 +0200)
pwx/check_tree.pl
pwx/last_mutual_commits.csv

index 0fba81834b0bd51a4ffe096350eaca1b691f7587..040682e1c7567b7975287143bacd2ec8e1ad223e 100755 (executable)
@@ -943,7 +943,8 @@ sub check_masks {
                                and return hunk_failed("check_masks: Mask start found while being in an insert block!");
                        substr($$line, 0, 1) = " "; ## Remove '-'
                        $in_mask_block = 1;
-                       $hHunk->{is_mask} = 1;
+                       $hHunk->{is_mask}  = 1;
+                       $hHunk->{is_endif} = 0;
 
                        # While we are here we can check the previous line.
                        # All masks shall be preceded by an empty line to enhance readability.
@@ -963,7 +964,10 @@ sub check_masks {
                        $in_insert_block
                                and return hunk_failed("check_masks: Insert start found while being in an insert block!");
                        substr($$line, 0, 1) = " "; ## Remove '-'
-                       $in_insert_block = 1;
+                       $in_insert_block   = 1;
+                       $hHunk->{is_mask}  = 0;
+                       $hHunk->{is_else}  = 0;
+                       $hHunk->{is_endif} = 0;
 
                        # While we are here we can check the previous line.
                        # All inserts shall be preceded by an empty line to enhance readability.
@@ -985,8 +989,10 @@ sub check_masks {
                    || ( $$line =~ m/else\s+-->\s*$/ ) 
                    || ( $$line =~ m,\*\s+else\s+\*\*/\s*$, ) ) ) {
                        substr($$line, 0, 1) = " "; ## Remove '-'
-                       $in_else_block    = 1;
-                       $hHunk->{is_else} = 1;
+                       $in_else_block     = 1;
+                       $in_mask_block
+                               and $hHunk->{is_else}  = 1;
+                       $hHunk->{is_endif} = 0;
                        next;
                }
 
@@ -1914,7 +1920,7 @@ sub unprepare_shell {
        $is_else  = 0;
        @lIn = splice(@{$hFile{output}});
        for my $line (@lIn) {
-               if ( $line =~ /^# emi (\d) (\d)$/ ) {
+               if ( $line =~ m/^\s*#\s+emi\s+([01])\s+([01])$/ ) {
                        $is_block = $1;
                        $is_else  = $2;
                        # This does not need to be transported.
@@ -1924,8 +1930,9 @@ sub unprepare_shell {
                $is_block or $is_else = 0;
                $line =~ m,^[ ]+#if 0 /* .*elogind.*, and $is_block = 1;
                $is_block and $line =~ m,^[ ]?#else, and $is_else = 1;
-               $is_block and (!$is_else) and ("#" ne substr($line, 1, 1))
-                       and "@@" ne substr($line, 0, 2) and substr($line, 1, 0) = "# ";
+               $is_block and (!$is_else)
+                       and "@@" ne substr($line, 0, 2)
+                       and substr($line, 1, 0) = "# ";
 
                push @{$hFile{output}}, $line;
        }
@@ -2007,7 +2014,7 @@ sub unprepare_xml {
        $is_else  = 0;
        @lIn = splice(@{$hFile{output}});
        for my $line (@lIn) {
-               if ( $line =~ /^# emi (\d) (\d)$/ ) {
+               if ( $line =~ m/^\s*#\s+emi\s+([01])\s+([01])$/ ) {
                        $is_block = $1;
                        $is_else  = $2;
                        # This does not need to be transported.
index d57cce4bac50e3fcd0ed39299e492663efb965ae..60af651402fd84eab77c307d8fbf6f8ce3a3f60d 100644 (file)
@@ -11,4 +11,4 @@
 ../systemd-upstream master      265710c20 src-efaa3176a x
 ../systemd-upstream v234        d6d0473dc src-782c925f7 x
 ../systemd-upstream v236        83fefc888 src-f78a88bec x
-../systemd-upstream v237        5a8af7471 src-6d8c71eb8 tgt-41bbfe402
+../systemd-upstream v237        245992a0c src-6d8c71eb8 tgt-970cccece