From 5198ce8db04f53f6c6b4cfc8e414f5cced8a31f8 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 13 Jun 2023 15:16:31 +0200 Subject: [PATCH] scripts: modernize abi-generate & find-firmware Signed-off-by: Thomas Lamprecht --- debian/scripts/abi-generate | 9 ++++++--- debian/scripts/find-firmware.pl | 15 ++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/debian/scripts/abi-generate b/debian/scripts/abi-generate index c4a26bf..458c601 100755 --- a/debian/scripts/abi-generate +++ b/debian/scripts/abi-generate @@ -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"; diff --git a/debian/scripts/find-firmware.pl b/debian/scripts/find-firmware.pl index 17cdaf8..a53223c 100755 --- a/debian/scripts/find-firmware.pl +++ b/debian/scripts/find-firmware.pl @@ -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 = )) { +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 = )) { + 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;