[Unstable][PATCH v2 3/5] UBUNTU: [Packaging] module-check: Handle current/new ABI modules directory

Juerg Haefliger juerg.haefliger at canonical.com
Thu Jun 10 08:08:05 UTC 2021


The previous commits converted the ABI from a single modules file to a
directory containing per-module files. Handle that for the current/new
ABI.

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 debian/scripts/module-check | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/scripts/module-check b/debian/scripts/module-check
index c754ea368cfb..2e31045f834f 100755
--- a/debian/scripts/module-check
+++ b/debian/scripts/module-check
@@ -13,9 +13,9 @@ if (-f "$prev_abidir/ignore.modules"
 	exit(0);
 }
 
-if (not -f "$abidir/$flavour.modules" or not -f
+if (not -d "$abidir/$flavour.modules" or not -f
     "$prev_abidir/$flavour.modules") {
-	print "previous or current modules file missing!\n";
+	print "previous or current modules file/directory missing!\n";
 	print "   $abidir/$flavour.modules\n";
 	print "   $prev_abidir/$flavour.modules\n";
 	if (defined($skipmodule)) {
@@ -52,10 +52,11 @@ if (-f "$prev_abidir/../modules.ignore") {
 # Read new modules first
 print "   reading new modules...";
 $new_count = 0;
-open(NEW, "< $abidir/$flavour.modules") or
-	die "Could not open $abidir/$flavour.modules";
-while (<NEW>) {
+opendir(NEW, "$abidir/$flavour.modules") or
+	die "Could not open directory $abidir/$flavour.modules";
+while (readdir NEW) {
 	chomp;
+	next if /^\./;  # Ignore '.' and '..'
 	$modules{$_} = 1;
 	$new_count++;
 }
-- 
2.27.0




More information about the kernel-team mailing list