The filter mechanism easy can be used by adding something like the following example in the corresponding nm file.
export FILTER_PERL_REQUIRES = \ Some::Module \ Example:: \ abc
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org --- src/scripts/perl.req | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/src/scripts/perl.req b/src/scripts/perl.req index 29bde1f2..5a5a54e1 100644 --- a/src/scripts/perl.req +++ b/src/scripts/perl.req @@ -20,6 +20,8 @@ # then these are treated as additional names which are required by the # file and are printed as well.
+my @filter = split(/ /, $ENV{'FILTER_PERL_REQUIRES'}); + my $BUILDROOT = shift;
# Check if BUILDROOT is set @@ -45,6 +47,8 @@ foreach my $perlver (sort keys %perlreq) { }
foreach my $module (sort keys %global_require) { + next if (&is_filtered($module)); + if (length($global_require{$module}) == 0) { print "perl($module)\n";
@@ -388,3 +392,11 @@ sub process_file {
return; } + +sub is_filtered($) { + my ($module) = @_; + + foreach my $item (@filter) { + return 1 if (index($module, $item) != -1); + } +}
Filter-out everything like perl(5), perl(v5), perl(5.000), perl(5.000_000) etc.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org --- src/scripts/perl.req | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/scripts/perl.req b/src/scripts/perl.req index 5a5a54e1..2bdf04dd 100644 --- a/src/scripts/perl.req +++ b/src/scripts/perl.req @@ -47,6 +47,7 @@ foreach my $perlver (sort keys %perlreq) { }
foreach my $module (sort keys %global_require) { + next if ($module =~ /^v?\d*.?\d*_?\d*$/); next if (&is_filtered($module));
if (length($global_require{$module}) == 0) {