summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2024-06-23 21:17:06 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2024-06-23 21:17:06 +0000
commitd54333f99b733484e9ed65a7de09c64a4b1099e9 (patch)
treed080d95f2097d3449a5b9838e380aade3e921913 /Build
parentab77fd2c3e6eec31e8b12904cf2ed72242372787 (diff)
Optionally replace optional tags.
Now we can update changefiles that only have 'l.NNN' line numbers, without duplicating these (as part of the 'text'). git-svn-id: svn://tug.org/texlive/trunk@71604 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/web2c/tests/fix-changefile-lines.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/tests/fix-changefile-lines.py b/Build/source/texk/web2c/tests/fix-changefile-lines.py
index 1f763fbda99..83d909c7eba 100755
--- a/Build/source/texk/web2c/tests/fix-changefile-lines.py
+++ b/Build/source/texk/web2c/tests/fix-changefile-lines.py
@@ -193,20 +193,23 @@ class ChangeReader:
# Remove leading @x.
text = self._lines[self._chunk_start][2:].strip()
- # Remove potentially leading [part.section] tag.
- pattern = "\\[\\d+(\\.\\d+)?\\]"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1).strip()
+ if opt_handler.part_b or opt_handler.section_b:
+ # Remove potentially leading [part.section] tag.
+ pattern = "\\[\\d+(\\.\\d+)?\\]"
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text, 1).strip()
+ if opt_handler.line_b:
# Remove potentially line number information.
pattern = "l\\.\\d+"
if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1)
+ text = re.sub(pattern, "", text, 1).strip()
- # Remove potentially text comment separator.
- pattern = " -*"
- if re.match(pattern, text):
- text = re.sub(pattern, "", text, 1).strip()
+ if opt_handler.hyphen_b:
+ # Remove potentially text comment separator.
+ pattern = "-+"
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text, 1).strip()
# Create line with standard tag and optional information.
new_line = "@x"