All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 12/26] scripts/documentation-file-ref-check: add a fix logic for DT
Date: Fri, 15 Jun 2018 13:30:40 -0300	[thread overview]
Message-ID: <31d20450593b3b6e354a675b7b4e1d35d1a864e9.1529079120.git.mchehab+samsung@kernel.org> (raw)
In-Reply-To: <cover.1529079119.git.mchehab+samsung@kernel.org>
In-Reply-To: <cover.1529079119.git.mchehab+samsung@kernel.org>

There are several links broken due to DT file movements. Add
a hint logic to seek for those changes.

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

diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
index 9d5e21b10346..c8bc1c1c1d6e 100755
--- a/scripts/documentation-file-ref-check
+++ b/scripts/documentation-file-ref-check
@@ -64,7 +64,7 @@ while (<IN>) {
 		next if (grep -e, glob("$ref $fulref"));
 
 		if ($fix) {
-			if (!($ref =~ m/(devicetree|scripts|Kconfig|Kbuild)/)) {
+			if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {
 				$broken_ref{$ref}++;
 			}
 		} else {
@@ -84,10 +84,19 @@ foreach my $ref (keys %broken_ref) {
 	# get just the basename
 	$new =~ s,.*/,,;
 
-	# Seek for the same name on another place, as it may have been moved
 	my $f="";
 
-	$f = qx(find . -iname $new) if ($new);
+	# usual reason for breakage: DT file moved around
+	if ($ref =~ /devicetree/) {
+		my $search = $new;
+		$search =~ s,^.*/,,;
+		$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+		if (!$f) {
+			# Manufacturer name may have changed
+			$search =~ s/^.*,//;
+			$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+		}
+	}
 
 	# usual reason for breakage: file renamed to .rst
 	if (!$f) {
@@ -95,6 +104,11 @@ foreach my $ref (keys %broken_ref) {
 		$f=qx(find . -iname $new) if ($new);
 	}
 
+	# Wild guess: seek for the same name on another place
+	if (!$f) {
+		$f = qx(find . -iname $new) if ($new);
+	}
+
 	my @find = split /\s+/, $f;
 
 	if (!$f) {
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 12/26] scripts/documentation-file-ref-check: add a fix logic for DT
Date: Fri, 15 Jun 2018 13:30:40 -0300	[thread overview]
Message-ID: <31d20450593b3b6e354a675b7b4e1d35d1a864e9.1529079120.git.mchehab+samsung@kernel.org> (raw)
In-Reply-To: <cover.1529079119.git.mchehab+samsung@kernel.org>
In-Reply-To: <cover.1529079119.git.mchehab+samsung@kernel.org>

There are several links broken due to DT file movements. Add
a hint logic to seek for those changes.

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

diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
index 9d5e21b10346..c8bc1c1c1d6e 100755
--- a/scripts/documentation-file-ref-check
+++ b/scripts/documentation-file-ref-check
@@ -64,7 +64,7 @@ while (<IN>) {
 		next if (grep -e, glob("$ref $fulref"));
 
 		if ($fix) {
-			if (!($ref =~ m/(devicetree|scripts|Kconfig|Kbuild)/)) {
+			if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {
 				$broken_ref{$ref}++;
 			}
 		} else {
@@ -84,10 +84,19 @@ foreach my $ref (keys %broken_ref) {
 	# get just the basename
 	$new =~ s,.*/,,;
 
-	# Seek for the same name on another place, as it may have been moved
 	my $f="";
 
-	$f = qx(find . -iname $new) if ($new);
+	# usual reason for breakage: DT file moved around
+	if ($ref =~ /devicetree/) {
+		my $search = $new;
+		$search =~ s,^.*/,,;
+		$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+		if (!$f) {
+			# Manufacturer name may have changed
+			$search =~ s/^.*,//;
+			$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+		}
+	}
 
 	# usual reason for breakage: file renamed to .rst
 	if (!$f) {
@@ -95,6 +104,11 @@ foreach my $ref (keys %broken_ref) {
 		$f=qx(find . -iname $new) if ($new);
 	}
 
+	# Wild guess: seek for the same name on another place
+	if (!$f) {
+		$f = qx(find . -iname $new) if ($new);
+	}
+
 	my @find = split /\s+/, $f;
 
 	if (!$f) {
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-06-15 16:38 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 16:30 [PATCH v4 00/26] Fix some doc build warnings/errors and broken links Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 01/26] docs: can.rst: fix a footnote reference Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 02/26] docs: crypto_engine.rst: Fix two parse warnings Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 03/26] arch/*: Kconfig: fix documentation for NMI watchdog Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 04/26] docs: fix broken references with multiple hints Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` [v4,04/26] " Mauro Carvalho Chehab
2018-06-15 16:30   ` [PATCH v4 04/26] " Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 18:22   ` James Morris
2018-06-15 18:22     ` James Morris
2018-06-15 18:22     ` James Morris
2018-06-15 18:22     ` [v4,04/26] " James Morris
2018-06-15 18:22     ` [PATCH v4 04/26] " James Morris
2018-06-15 18:22     ` James Morris
2018-06-20 15:26   ` Rob Herring
2018-06-20 15:26     ` Rob Herring
2018-06-20 15:26     ` Rob Herring
2018-06-20 15:26     ` [v4,04/26] " Rob Herring
2018-06-20 15:26     ` [PATCH v4 04/26] " Rob Herring
2018-06-20 15:26     ` Rob Herring
2018-06-15 16:30 ` [PATCH v4 05/26] docs: Fix some broken references Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` [v4,05/26] " Mauro Carvalho Chehab
2018-06-15 16:30   ` [PATCH v4 05/26] " Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 06/26] media: dvb: fix location of get_dvb_firmware script Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 07/26] media: dvb: point to the location of the old README.dvb-usb file Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 08/26] media: v4l: fix broken video4linux docs locations Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 09/26] media: max2175: fix location of driver's companion documentation Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:34   ` Ramesh Shanmugasundaram
2018-06-15 16:34     ` Ramesh Shanmugasundaram
2018-06-15 16:30 ` [PATCH v4 10/26] scripts/documentation-file-ref-check: fix help message Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 11/26] scripts/documentation-file-ref-check: accept more wildcards at filenames Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab [this message]
2018-06-15 16:30   ` [PATCH v4 12/26] scripts/documentation-file-ref-check: add a fix logic for DT Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 13/26] scripts/documentation-file-ref-check: hint: dash or underline Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 14/26] scripts/documentation-file-ref-check: get rid of false-positives Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 15/26] scripts/documentation-file-ref-check: check tools/*/Documentation Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 16/26] docs: Fix more broken references Mauro Carvalho Chehab
2018-06-15 16:30   ` [Intel-wired-lan] " Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` [v4,16/26] " Mauro Carvalho Chehab
2018-06-15 16:30   ` [PATCH v4 16/26] " Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:41   ` Miguel Ojeda
2018-06-15 16:41     ` [Intel-wired-lan] " Miguel Ojeda
2018-06-15 16:41     ` Miguel Ojeda
2018-06-15 16:41     ` [v4,16/26] " Miguel Ojeda
2018-06-15 16:41     ` [PATCH v4 16/26] " Miguel Ojeda
2018-06-15 16:41     ` Miguel Ojeda
2018-06-15 16:30 ` [PATCH v4 17/26] bindings: nvmem/zii: Fix location of nvmem.txt Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 18/26] kernel-parameters.txt: fix pointers to sound parameters Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 19/26] MAINTAINERS: fix location of some display DT bindings Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 23:38   ` Eric Anholt
2018-06-15 16:30 ` [PATCH v4 20/26] MAINTAINERS: fix location of DT npcm files Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 21/26] devicetree: fix some bindings file names Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 22/26] devicetree: fix name of pinctrl-bindings.txt Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-18  5:48   ` Lee Jones
2018-06-18  5:48     ` Lee Jones
2018-06-15 16:30 ` [PATCH v4 23/26] devicetree: fix a series of wrong file references Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-18  5:49   ` Lee Jones
2018-06-18  5:49     ` Lee Jones
2018-06-18  5:49     ` Lee Jones
2018-06-18  5:49     ` Lee Jones
2018-06-18  5:49     ` Lee Jones
2018-06-28 13:53   ` Bjorn Helgaas
2018-06-28 13:53     ` Bjorn Helgaas
2018-06-28 13:53     ` Bjorn Helgaas
2018-06-28 13:53     ` Bjorn Helgaas
2018-06-28 13:53     ` Bjorn Helgaas
2018-08-07  7:04   ` Chen-Yu Tsai
2018-08-07  7:04     ` Chen-Yu Tsai
2018-08-07  7:04     ` Chen-Yu Tsai
2018-08-07  7:04     ` Chen-Yu Tsai
2018-06-15 16:30 ` [PATCH v4 24/26] ABI: sysfs-devices-system-cpu: remove a broken reference Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 25/26] Documentation: rstFlatTable.py: fix " Mauro Carvalho Chehab
2018-06-15 16:30   ` Mauro Carvalho Chehab
2018-06-15 19:09 ` [PATCH v4 00/26] Fix some doc build warnings/errors and broken links Jonathan Corbet
2018-06-15 19:09   ` Jonathan Corbet
2018-06-15 19:09   ` Jonathan Corbet
2018-06-15 20:52   ` Mauro Carvalho Chehab
2018-06-15 20:52     ` Mauro Carvalho Chehab
2018-06-15 20:52     ` Mauro Carvalho Chehab
2018-06-15 16:30 [v4,26/26] fix a series of Documentation/ broken file name references Mauro Carvalho Chehab
2018-06-15 16:30 ` [PATCH v4 26/26] " Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab
2018-06-15 16:30 ` Mauro Carvalho Chehab
2018-06-16 15:52 [v4,26/26] " Rafael J. Wysocki
2018-06-16 15:52 ` [PATCH v4 26/26] " Rafael J. Wysocki
2018-06-16 15:52 ` Rafael J. Wysocki
2018-06-16 15:52 ` Rafael J. Wysocki
2018-06-16 15:52 ` Rafael J. Wysocki
2018-06-19  4:14 [v4,26/26] " Vinod Koul
2018-06-19  4:26 ` [PATCH v4 26/26] " Vinod
2018-06-19  4:14 ` Vinod
2018-06-19  4:14 ` Vinod
2018-06-19  4:14 ` Vinod

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=31d20450593b3b6e354a675b7b4e1d35d1a864e9.1529079120.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.