summaryrefslogtreecommitdiff
path: root/pwx
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-05-29 08:04:43 +0200
committerSven Eden <yamakuzure@gmx.net>2018-05-29 08:04:43 +0200
commit3e53473a26ff176e0b52039330903299bed6380d (patch)
tree8bef6c3982f3e8ac049c8b394e84f43da569d5b5 /pwx
parent7272c8e8c21a8c91f65647b9b9d233857ba46597 (diff)
check_tree.pl: The word "systemd" is no longer changed to "elogind",
if it was found in a comment block that is added by the patch.
Diffstat (limited to 'pwx')
-rwxr-xr-xpwx/check_tree.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/pwx/check_tree.pl b/pwx/check_tree.pl
index fb2978437..c9711fb38 100755
--- a/pwx/check_tree.pl
+++ b/pwx/check_tree.pl
@@ -29,6 +29,8 @@
# 0.9.3 2018-05-25 sed, PrydeWorX Made check_musl() and check_name_reverts() safer. Further policy.in
# consist of XML code, and are now handled by (un)prepare_xml().
# 0.9.4 2018-05-29 sed, PrydeWorX Fixed a bug that caused #else to not be unremoved in __GLIBC__ blocks.
+# The word "systemd" is no longer changed to "elogind", if it was
+# found in a comment block that is added by the patch.
#
# ========================
# === Little TODO list ===
@@ -1134,6 +1136,10 @@ sub check_name_reverts {
# Note down what is changed, so we can have inline updates
my %hRemovals = ();
+ # Remember enmtering and ending newly inserted comments.
+ # We do not rename in them.
+ my $is_in_comment = 0;
+
# Remember the final mask state for later reversal
# ------------------------------------------------
my $hunk_ends_in_mask = $in_mask_block;
@@ -1169,6 +1175,11 @@ sub check_name_reverts {
next;
}
+ # Check for comments that get added
+ # ---------------------------------
+ ($$line =~ m,^\+\s*/[*]+,) and $is_in_comment = 1;
+ ($$line =~ m,^\+.*\*/[^/]*$,) and $is_in_comment = 0;
+
# Check Additions
# ---------------------------------
if ($$line =~ m/^\+[# ]*\s*(.*systemd.*)\s*$/) {
@@ -1212,6 +1223,7 @@ sub check_name_reverts {
# --- Unless we are in a mask block. ---
# -------------------------------------------------------------
$in_mask_block > 0 and (0 == $in_else_block) and next;
+ $is_in_comment and next;
$our_text_long eq $replace_text
and $$line =~ s/^\+([# ]*\s*).*systemd.*(\s*)$/+${1}${our_text_short}${2}/
or $$line =~ s/^\+([# ]*\s*).*systemd.*(\s*)$/+${1}${our_text_long }${2}/;