@@ -13,8 +13,8 @@ if (-f "$prev_abidir/ignore.modules"
exit(0);
}
-if (not -d "$abidir/$flavour.modules" or not -f
- "$prev_abidir/$flavour.modules") {
+if (not -d "$abidir/$flavour.modules" or
+ not -e "$prev_abidir/$flavour.modules") {
print "previous or current modules file/directory missing!\n";
print " $abidir/$flavour.modules\n";
print " $prev_abidir/$flavour.modules\n";
@@ -66,10 +66,18 @@ 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>) {
+if (-d "$prev_abidir/$flavour.modules") {
+ opendir(OLD, "$prev_abidir/$flavour.modules") or
+ die "Could not open directory $prev_abidir/$flavour.modules";
+ @old = readdir OLD;
+} else {
+ open(OLD, "< $prev_abidir/$flavour.modules") or
+ die "Could not open $prev_abidir/$flavour.modules";
+ @old = <OLD>;
+}
+for (@old) {
chomp;
+ next if /^\./; # Ignore '.' and '..'
if (not defined($modules{$_})) {
print "\n" if not $missing;
$missing++;
Handle the modules directory of the previous ABI. We still need to support the old style single module list until getabis retrieves an updated buildinfo package. Signed-off-by: Juerg Haefliger <juergh@canonical.com> --- debian/scripts/module-check | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)