From e2356719773f7cfb6abe0f49a45486e1f7b0c5e6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 25 Mar 2008 14:09:24 -0400 Subject: dh_perl: Remove empty directories created by MakeMaker. --- dh_perl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dh_perl') diff --git a/dh_perl b/dh_perl index 7e446b53..fbeee2d9 100755 --- a/dh_perl +++ b/dh_perl @@ -2,7 +2,7 @@ =head1 NAME -dh_perl - calculates perl dependencies +dh_perl - calculates perl dependencies and cleans up after MakeMaker =cut @@ -25,6 +25,9 @@ and will use this information to generate a dependency on perl or perlapi. The dependency will be substituted into your package's control file wherever you place the token "${perl:Depends}". +dh_perl also cleans up empty directories that MakeMaker can generate when +installing perl modules. + =head1 OPTIONS =over 4 @@ -135,6 +138,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) { addsubstvar($package, "perl:Depends", "perlapi-$Config{version}") if $deps & XS_MODULE; } + + # MakeMaker always makes lib and share dirs, but typically + # only one directory is installed into. + foreach my $dir ("$tmp/usr/share/perl5", "$tmp/usr/lib/perl5") { + if (-d $dir) { + doit("rmdir", "--ignore-fail-on-non-empty", "--parents", + "$dir"); + } + } } =head1 SEE ALSO -- cgit v1.2.3