linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: [PATCH 01/10] scripts/documentation-file-ref-check: better handle translations
Date: Mon, 20 May 2019 11:47:30 -0300	[thread overview]
Message-ID: <e2f07cda112179828d52a8aeb06eebcf6576360e.1558362030.git.mchehab+samsung@kernel.org> (raw)
In-Reply-To: <cover.1558362030.git.mchehab+samsung@kernel.org>

Only seek for translation renames inside the translation
directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
 scripts/documentation-file-ref-check | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
index 63e9542656f1..6b622b88f4cf 100755
--- a/scripts/documentation-file-ref-check
+++ b/scripts/documentation-file-ref-check
@@ -141,6 +141,10 @@ print "Auto-fixing broken references. Please double-check the results\n";
 foreach my $ref (keys %broken_ref) {
 	my $new =$ref;
 
+	my $basedir = ".";
+	# On translations, only seek inside the translations directory
+	$basedir  = $1 if ($ref =~ m,(Documentation/translations/[^/]+),);
+
 	# get just the basename
 	$new =~ s,.*/,,;
 
@@ -161,18 +165,18 @@ foreach my $ref (keys %broken_ref) {
 	# usual reason for breakage: file renamed to .rst
 	if (!$f) {
 		$new =~ s/\.txt$/.rst/;
-		$f=qx(find . -iname $new) if ($new);
+		$f=qx(find $basedir -iname $new) if ($new);
 	}
 
 	# usual reason for breakage: use dash or underline
 	if (!$f) {
 		$new =~ s/[-_]/[-_]/g;
-		$f=qx(find . -iname $new) if ($new);
+		$f=qx(find $basedir -iname $new) if ($new);
 	}
 
 	# Wild guess: seek for the same name on another place
 	if (!$f) {
-		$f = qx(find . -iname $new) if ($new);
+		$f = qx(find $basedir -iname $new) if ($new);
 	}
 
 	my @find = split /\s+/, $f;
-- 
2.21.0


  reply	other threads:[~2019-05-20 14:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 14:47 [PATCH 00/10] Fix broken documentation references at v5.2-rc1 Mauro Carvalho Chehab
2019-05-20 14:47 ` Mauro Carvalho Chehab [this message]
2019-05-20 14:47 ` [PATCH 02/10] scripts/documentation-file-ref-check: exclude false-positives Mauro Carvalho Chehab
2019-05-20 14:47 ` [PATCH 03/10] scripts/documentation-file-ref-check: improve tools ref handling Mauro Carvalho Chehab
2019-05-20 14:47 ` [PATCH 04/10] scripts/documentation-file-ref-check: teach about .txt -> .yaml renames Mauro Carvalho Chehab
2019-05-20 14:47 ` [PATCH 05/10] ABI: sysfs-devices-system-cpu: point to the right docs Mauro Carvalho Chehab
2019-05-20 14:47 ` [PATCH 06/10] isdn: mISDN: remove a bogus reference to a non-existing doc Mauro Carvalho Chehab
2019-05-20 14:47 ` [PATCH 07/10] mfd: madera: point to the right pinctrl binding file Mauro Carvalho Chehab
2019-05-20 15:42   ` Charles Keepax
2019-05-20 18:48     ` Mauro Carvalho Chehab
2019-05-20 14:47 ` [PATCH 08/10] dt: fix refs that were renamed to json with the same file name Mauro Carvalho Chehab
2019-05-20 15:57   ` Rob Herring
2019-05-20 16:13     ` Mauro Carvalho Chehab
2019-05-20 23:00       ` Rob Herring
2019-05-20 14:47 ` [PATCH 09/10] dt: fix broken references to nand.txt Mauro Carvalho Chehab
2019-05-20 15:37   ` Miquel Raynal
2019-05-20 14:47 ` [PATCH 10/10] docs: fix broken documentation links Mauro Carvalho Chehab
2019-05-20 15:05   ` Wolfram Sang
2019-05-21 22:56   ` Federico Vaga
2019-05-27  8:43   ` Rafael J. Wysocki
2019-05-21 22:54 ` [PATCH 00/10] Fix broken documentation references at v5.2-rc1 Federico Vaga
2019-05-22  0:26   ` Mauro Carvalho Chehab
2019-05-22 20:18     ` Federico Vaga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e2f07cda112179828d52a8aeb06eebcf6576360e.1558362030.git.mchehab+samsung@kernel.org \
    --to=mchehab+samsung@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).