]> git.proxmox.com Git - pve-kernel.git/commitdiff
scripts: modernize abi-generate & find-firmware
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Jun 2023 13:16:31 +0000 (15:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Jun 2023 14:14:24 +0000 (16:14 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/scripts/abi-generate
debian/scripts/find-firmware.pl

index c4a26bfb8f720cfed6f9c89eaeca955215deb038..458c601f4062b744311154e20400c9e3c12a9958 100755 (executable)
@@ -1,8 +1,11 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
-use PVE::Tools;
+use strict;
+use warnings;
 
-use IO::File;
+use PVE::Tools ();
+
+use IO::File ();
 
 sub usage {
     die "USAGE: $0 INFILE OUTFILE [ABI INFILE-IS-DEB]\n";
index 17cdaf817e64368e79a706e8e904a407f87a5ba4..a53223c95fbf6ee9452c46e3b140193bfc2dccf1 100755 (executable)
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 
 my $dir = shift;
 
@@ -12,21 +13,21 @@ warn "\n\nNOTE: strange directory name: $dir\n\n" if $dir !~ m|^(.*/)?(\d+.\d+.\
 
 my $apiver = $2;
 
-open(TMP, "find '$dir' -name '*.ko'|");
-while (defined(my $fn = <TMP>)) {
+open(my $FIND_KO_FH, "find '$dir' -name '*.ko'|");
+while (defined(my $fn = <$FIND_KO_FH>)) {
     chomp $fn;
     my $relfn = $fn;
     $relfn =~ s|^$dir/*||;
 
     my $cmd = "/sbin/modinfo -F firmware '$fn'";
-    open(MOD, "$cmd|");
-    while (defined(my $fw = <MOD>)) {
+    open(my $MOD_FH, "$cmd|");
+    while (defined(my $fw = <$MOD_FH>)) {
        chomp $fw;
        print "$fw $relfn\n";
     }
-    close(MOD);
+    close($MOD_FH);
 
 }
-close TMP;
+close($FIND_KO_FH);
 
 exit 0;