Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ca862e6 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Jonathan Corbet
Browse files

scripts/documentation-file-ref-check: teach about .txt -> .yaml renames



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

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 4904aeed
Loading
Loading
Loading
Loading
+14 −5
Original line number Original line Diff line number Diff line
@@ -165,6 +165,14 @@ foreach my $ref (keys %broken_ref) {


	# usual reason for breakage: DT file moved around
	# usual reason for breakage: DT file moved around
	if ($ref =~ /devicetree/) {
	if ($ref =~ /devicetree/) {
		# usual reason for breakage: DT file renamed to .yaml
		if (!$f) {
			my $new_ref = $ref;
			$new_ref =~ s/\.txt$/.yaml/;
			$f=$new_ref if (-f $new_ref);
		}

		if (!$f) {
			my $search = $new;
			my $search = $new;
			$search =~ s,^.*/,,;
			$search =~ s,^.*/,,;
			$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
			$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
@@ -174,6 +182,7 @@ foreach my $ref (keys %broken_ref) {
				$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
				$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
			}
			}
		}
		}
	}


	# usual reason for breakage: file renamed to .rst
	# usual reason for breakage: file renamed to .rst
	if (!$f) {
	if (!$f) {