File 2052-docs-Fix-some-broken-links.patch of Package erlang

From a3a21b7f226ccdda56271d044fc7fe8a18e1827a Mon Sep 17 00:00:00 2001
From: Johannes Christ <jc@jchri.st>
Date: Thu, 1 Jun 2023 13:15:45 +0200
Subject: [PATCH 2/2] docs: Fix some broken links

Co-authored-by: Lukas Larsson <garazdawi@gmail.com>
---
 HOWTO/DTRACE.md                              |  2 +-
 lib/common_test/doc/src/run_test_chapter.xml |  4 ++--
 lib/inets/doc/src/mod_alias.xml              |  2 +-
 lib/megaco/doc/src/megaco_intro.xml          |  6 +++---
 lib/public_key/doc/src/public_key_app.xml    |  2 +-
 scripts/otp_html_check                       | 14 +++++++-------
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/scripts/otp_html_check b/scripts/otp_html_check
index 043ed222d6..7adb94dcd4 100755
--- a/scripts/otp_html_check
+++ b/scripts/otp_html_check
@@ -60,9 +60,9 @@ my %anchor_defs;		# <a name="..."> in the form "$page#$anchor"
 
 @ARGV or usage("No base directory given");
 my $base = shift @ARGV;
-my @print_external_links = 0;
+my $print_external_links = 0;
 if ($base eq "--print-external-links") {
-    @print_external_links = 1;
+    $print_external_links = 1;
     $base = shift @ARGV;
 }
 -d $base or usage("Not a directory: $base");
@@ -284,7 +284,10 @@ sub normalize_link {
 
     # mailto: http: .....
     if ($link =~ /^\w{3,10}:/i) {
-        if ((@print_external_links)
+        # Exclude "Edit on GitHub" links. These would make up
+        # the majority of the output and there's likely little
+        # value in checking them.
+        if (($print_external_links)
             && ($link !~ /github\.com\/erlang\/otp/) 
             && ($link =~ /^http/)) {
                 push(@external_links, [$page, $link]);
@@ -421,16 +424,13 @@ if (keys %anchor_refs) {
     }
 }
 
-if (@print_external_links) {
+if ($print_external_links) {
   print "\n**** External links (excluding github.com/erlang/otp)\n\n";
 
   while (@external_links) {
     my $page_and_link = shift @external_links;
     my ($page, $link) = @$page_and_link;
     if ($link =~ /^\w{3,10}:/i) {
-      # Exclude "Edit on GitHub" links. These would make up
-      # the majority of the output and there's likely little
-      # value in checking them.
       print "$page -> $link\n";
     }
   }
-- 
2.35.3

openSUSE Build Service is sponsored by