diff mbox series

[Unstable,2/2] UBUNTU: [Packaging] abi-check: Process modules.builtin

Message ID 20210511072834.488740-3-juergh@canonical.com
State New
Headers show
Series Add modules.builtin to the ABI | expand

Commit Message

Juerg Haefliger May 11, 2021, 7:28 a.m. UTC
The previous commit introduced a new file modules.builtin that lists all
built-in modules. Take the content of that file into account during the ABI
check so that modules that changed from 'm' to 'y' don't result in a build
failure.

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
---
 debian/scripts/module-check | 56 ++++++++++++++++++++++---------------
 1 file changed, 34 insertions(+), 22 deletions(-)
diff mbox series

Patch

diff --git a/debian/scripts/module-check b/debian/scripts/module-check
index c754ea368cfb..fe2717044426 100755
--- a/debian/scripts/module-check
+++ b/debian/scripts/module-check
@@ -52,38 +52,50 @@  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>) {
-	chomp;
-	$modules{$_} = 1;
-	$new_count++;
+@files = ("$abidir/$flavour.modules");
+if (-f "$abidir/$flavour.modules.builtin") {
+	push(@files, "$abidir/$flavour.modules.builtin");
+}
+for $file (@files) {
+	open(NEW, "< $file") or
+		die "Could not open $file";
+	while (<NEW>) {
+		chomp;
+		$modules{$_} = 1;
+		$new_count++;
+	}
+	close(NEW);
 }
-close(NEW);
 print "read $new_count modules.\n";
 
 # Now the old modules, checking for missing ones
 print "   reading old modules...";
 $old_count = 0;
-open(OLD, "< $prev_abidir/$flavour.modules") or
-	die "Could not open $prev_abidir/$flavour.modules";
-while (<OLD>) {
-	chomp;
-	if (not defined($modules{$_})) {
-		print "\n" if not $missing;
-		$missing++;
-		if (not defined($modules_ignore{$_})) {
-			print "      MISS: $_\n";
-			$errors++;
+@files = ("$prev_abidir/$flavour.modules");
+if (-f "$prev_abidir/$flavour.modules.builtin") {
+	push(@files, "$prev_abidir/$flavour.modules.builtin");
+}
+for $file (@files) {
+	open(OLD, "< $file") or
+		die "Could not open $file";
+	while (<OLD>) {
+		chomp;
+		if (not defined($modules{$_})) {
+			print "\n" if not $missing;
+			$missing++;
+			if (not defined($modules_ignore{$_})) {
+				print "      MISS: $_\n";
+				$errors++;
+			} else {
+				print "      MISS: $_ (ignored)\n";
+			}
 		} else {
-			print "      MISS: $_ (ignored)\n";
+			$modules{$_}++;
 		}
-	} else {
-		$modules{$_}++;
+		$old_count++;
 	}
-	$old_count++;
+	close(OLD);
 }
-close(OLD);
 # Check for new modules
 foreach $mod (keys(%modules)) {
 	if ($modules{$mod} < 2) {