From 76fc95f307e2388da26e0d000516af92fbc3ca22 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Sun, 25 Jul 2021 07:17:50 +0200 Subject: [PATCH] Generate .patterns (plural) files. --- tools/generate_firmware_patterns | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/generate_firmware_patterns b/tools/generate_firmware_patterns index 6b7c3962..b56289de 100755 --- a/tools/generate_firmware_patterns +++ b/tools/generate_firmware_patterns @@ -1,7 +1,7 @@ #!/usr/bin/perl # © 2021 Cyril Brulebois # -# Generate ready-to-use pattern files so that one can use grep to +# Generate ready-to-use .patterns files so that one can use grep to # perform hardware to firmware-package lookups in the installer # (see MODALIAS= lines in `udevadm info --export-db`), see the # hw-detect component. @@ -69,14 +69,14 @@ sub process_components { print STDERR "found modaliases entries for firmware package ", $array->{Package}, "\n" if $verbose; - my $pattern_file = $output_dir . "/" . $array->{Package} . ".pattern"; + my $patterns_file = $output_dir . "/" . $array->{Package} . ".patterns"; printf STDERR "writing %d entries to %s\n", (scalar @{ $array->{Provides}->{modaliases} }), - $pattern_file; + $patterns_file; # For each alias, anchor the pattern on the left (^) and on # the right ($), and replace each '*' with '.*': - write_file($pattern_file, + write_file($patterns_file, map { $a = $_; $a =~ s/[*]/.*/g; "^$a\$\n" } @{ $array->{Provides}->{modaliases} }); }