Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf057781

Browse files
committed
Improve Perl script which adds commit links to release notes
Reported-by: Andrew DunstanDiscussion:https://postgr.es/m/b2465837-56df-4794-a0b5-5e6ed44ed870@dunslane.netAuthor: Andrew DunstanBackpatch-through: 12
1 parent4c57fac commitf057781

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

‎src/tools/add_commit_links.pl

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ sub process_file
5151
$file =~m/-(\d+)\./;
5252
my$major_version =$1;
5353

54-
open(my$fh,'<',$file) ||die"could not open file%s:$!\n",$file;
55-
open(my$tfh,'>',$tmpfile) ||die"could not open file%s:$!\n",
56-
$tmpfile;
54+
open(my$fh,'<',$file) ||die"could not open file$file:$!\n";
55+
open(my$tfh,'>',$tmpfile) ||die"could not open file$tmpfile:$!\n";
5756

5857
while (<$fh>)
5958
{
@@ -64,9 +63,9 @@ sub process_file
6463
# skip over commit links because we will add them below
6564
next
6665
if (!$in_comment &&
67-
m{^\s*<ulink url="&commit_baseurl;[\da-f]+">&sect;</ulink>\s*$});
66+
m{^\s*<ulink url="&commit_baseurl;[[:xdigit:]]+">&sect;</ulink>\s*$});
6867

69-
if ($in_comment &&m/\[([\da-f]+)\]/)
68+
if ($in_comment &&m/\[([[:xdigit:]]+)\]/)
7069
{
7170
my$hash =$1;
7271

@@ -88,23 +87,21 @@ sub process_file
8887
{
8988
formy$hash (@hashes)
9089
{
91-
print({$tfh}
92-
"$prev_leading_space<ulink url=\"&commit_baseurl;$hash\">&sect;</ulink>\n"
93-
);
90+
print$tfh
91+
"$prev_leading_space<ulink url=\"&commit_baseurl;$hash\">&sect;</ulink>\n";
9492
}
9593
@hashes = ();
9694
}
9795
else
9896
{
99-
printf(
100-
"hashes found but no matching text found for placement on line%s\n",
101-
$lineno);
97+
print
98+
"hashes found but no matching text found for placement on line$lineno\n";
10299
exit(1);
103100
}
104101
}
105102
}
106103

107-
print({$tfh}$_);
104+
print$tfh$_;
108105

109106
$prev_line_ended_with_paren =m/\)\s*$/;
110107

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp