From 4ecfc231b858e370cf62f7c5a0d5fb3073d25a9f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 17 May 2017 10:24:00 +0200 Subject: [PATCH] Show all available distro configs Change-Id: Ibecd89bb12b3e488a4cf25766bd6ffe5a097f135 --- autogen.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/autogen.sh b/autogen.sh index b021ccc05f29..bff17cd5b2b5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -102,18 +102,30 @@ sub read_args($) return @lst; } +sub show_distro_configs($$) +{ + my ($prefix, $path) = @_; + my $dirh; + opendir ($dirh, "$path"); + while (($_ = readdir ($dirh))) { + if (-d "$path/$_") { + show_distro_configs( + $prefix eq "" ? "$_/" : "$prefix/$_/", "$path/$_") + unless $_ eq '.' || $_ eq '..'; + next; + } + /(.*)\.conf$/ || next; + print STDERR "\t$prefix$1\n"; + } + closedir ($dirh); +} + sub invalid_distro($$) { my ($config, $distro) = @_; print STDERR "Can't find distro option set: $config\nThis is not necessarily a problem.\n"; print STDERR "Distros with distro option sets are:\n"; - my $dirh; - opendir ($dirh, "$src_path/distro-configs"); - while (($_ = readdir ($dirh))) { - /(.*)\.conf$/ || next; - print STDERR "\t$1\n"; - } - closedir ($dirh); + show_distro_configs("", "$src_path/distro-configs"); } # Avoid confusing "aclocal: error: non-option arguments are not accepted: '.../m4'." error message.