summaryrefslogtreecommitdiffstats
path: root/commands/find-dups
diff options
context:
space:
mode:
Diffstat (limited to 'commands/find-dups')
-rwxr-xr-xcommands/find-dups24
1 files changed, 24 insertions, 0 deletions
diff --git a/commands/find-dups b/commands/find-dups
new file mode 100755
index 0000000..7c4d45a
--- /dev/null
+++ b/commands/find-dups
@@ -0,0 +1,24 @@
+#!/bin/bash -e
+# Find duplicate modules. Pass the kernel name.
+kernel=$1
+(
+ shopt -s nullglob
+ for dir in debian/*-modules-$kernel-di; do
+ cd $dir
+ find lib -type f -printf "$dir %p\n"
+ cd ../..
+ done
+) | sort -k2 | perl -ne '
+ my $configdir = ($ENV{KW_CONFIG_DIR} || ".");
+ while (<>) {
+ ($d, $f)=split;
+ if ($f eq $lf) { print "$d $f\n$ld $lf\n"; $dups++ }
+ $lf=$f;
+ $ld=$d
+ }
+ if ($dups) {
+ print STDERR "some modules are in more than one package\n";
+ exit 1 unless (-e "$configdir/ignore-dups" ||
+ length($ENV{KW_CHECK_NONFATAL}));
+ }
+'