LKML Archive on 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>
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 08/10] scripts/documentation-file-ref-check: teach about .txt -> .yaml renames
Date: Wed, 29 May 2019 20:09:30 -0300	[thread overview]
Message-ID: <a301b6e922407c12279d7ca51b70156673e66ddc.1559170790.git.mchehab+samsung@kernel.org> (raw)
In-Reply-To: <cover.1559170790.git.mchehab+samsung@kernel.org>

At DT, files are being renamed to jason. Teach the script how to
handle such renames when used in fix mode.

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

diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
index 5d775ca7469b..ff16db269079 100755
--- a/scripts/documentation-file-ref-check
+++ b/scripts/documentation-file-ref-check
@@ -165,13 +165,22 @@ foreach my $ref (keys %broken_ref) {
 
 	# 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);
+		# usual reason for breakage: DT file renamed to .yaml
 		if (!$f) {
-			# Manufacturer name may have changed
-			$search =~ s/^.*,//;
+			my $new_ref = $ref;
+			$new_ref =~ s/\.txt$/.yaml/;
+			$f=$new_ref if (-f $new_ref);
+		}
+
+		if (!$f) {
+			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);
+			}
 		}
 	}
 
-- 
2.21.0


  parent reply	other threads:[~2019-05-29 23:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 23:09 [PATCH 00/10] Improvements to the documentation build system Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 01/10] docs: cdomain.py: get rid of a warning since version 1.8 Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 02/10] scripts/sphinx-pre-install: make activate hint smarter Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 03/10] scripts/sphinx-pre-install: get rid of RHEL7 explicity check Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 04/10] scripts/sphinx-pre-install: always check if version is compatible with build Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 05/10] scripts/documentation-file-ref-check: better handle translations Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 06/10] scripts/documentation-file-ref-check: exclude false-positives Mauro Carvalho Chehab
2019-05-29 23:09 ` [PATCH 07/10] scripts/documentation-file-ref-check: improve tools ref handling Mauro Carvalho Chehab
2019-05-29 23:09 ` Mauro Carvalho Chehab [this message]
2019-05-29 23:09 ` [PATCH 09/10] docs: by default, build docs a lot faster with Sphinx >= 1.7 Mauro Carvalho Chehab
2019-06-04  8:14   ` Jani Nikula
2019-05-29 23:09 ` [PATCH 10/10] docs: requirements.txt: recommend Sphinx 1.7.9 Mauro Carvalho Chehab
2019-05-30 16:43 ` [PATCH 00/10] Improvements to the documentation build system Jonathan Corbet

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=a301b6e922407c12279d7ca51b70156673e66ddc.1559170790.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).