Commit 3a1cc06c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Greg Kroah-Hartman
Browse files

scripts: get_abi.pl: produce an error if the ref tree is broken



The logic under graph_add_file should create, for every entry, a
__name name array for all entries of the tree. If this fails, the
symlink parsing will break.

Add an error if this ever happens.

While here, improve the output of data dumper to be more
compact and to avoid displaying things like $VAR1=.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/e7dd4d70e206723455d50c851802c8bb6c34941d.1632750315.git.mchehab+huawei@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3cb1fead
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ my $dbg_what_open = 2;
my $dbg_dump_abi_structs = 4;
my $dbg_undefined = 8;

$Data::Dumper::Indent = 1;
$Data::Dumper::Terse = 1;

#
# If true, assumes that the description is formatted with ReST
#
@@ -597,7 +600,6 @@ sub graph_add_link {

	my @queue;
	my %seen;
	my $base_name;
	my $st;

	push @queue, $file_ref;
@@ -611,6 +613,12 @@ sub graph_add_link {
			next if $seen{$$v{$c}};
			next if ($c eq "__name");

			if (!defined($$v{$c}{"__name"})) {
				printf STDERR "Error: Couldn't find a non-empty name on a children of $file/.*: ";
				print STDERR Dumper(%{$v});
				exit;
			}

			# Add new name
			my $name = @{$$v{$c}{"__name"}}[0];
			if ($name =~ s#^$file/#$link/#) {