+if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) {
+ # . as srcdir makes no sense, so this is a special case.
+ if ($srcdir eq '.') {
+ $srcdir='debian/tmp';
+ }
+
+ my @missing;
+ my $installed=join("|", map {
+ # Kill any extra slashes, for robustness.
+ y:/:/:s;
+ s:/+$::;
+ s:^(\./)*::;
+ "\Q$_\E\/.*|\Q$_\E";
+ } @installed);
+ $installed=qr{^($installed)$};
+ find(sub {
+ -f || -l || return;
+ $_="$File::Find::dir/$_";
+ if (! /$installed/ && ! excludefile($_)) {
+ my $file=$_;
+ $file=~s/^\Q$srcdir\E\///;
+ push @missing, $file;
+ }
+ }, $srcdir);
+ if (@missing) {
+ warning "$_ exists in $srcdir but is not installed to anywhere" foreach @missing;
+ if ($dh{FAIL_MISSING}) {
+ error("missing files, aborting");
+ }
+ }
+}
+
+=head1 LIMITATIONS
+
+B<dh_install> cannot rename files or directories, it can only install them
+with the names they already have into wherever you want in the package
+build tree.
+