]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_builddeb
Merge branch 'master' into buildsystems
[debhelper.git] / dh_builddeb
index 31bcdc67d2b9aeb015ab4b4e2066427ec85590a8..45713fd946a64af09c61e78914b1ddbcad4edde4 100755 (executable)
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-dh_builddeb - build debian packages
+dh_builddeb - build debian binary packages
 
 =cut
 
@@ -43,7 +43,10 @@ package.
 
 =cut
 
-init();
+init(options => {
+       "filename=s" => \$dh{FILENAME},
+       "destdir=s" => \$dh{DESTDIR},
+});
 
 # Set the default destination directory.
 if (! defined $dh{DESTDIR}) {
@@ -60,8 +63,15 @@ else {
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
        if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) {
-               complex_doit("find $tmp -name $_ | xargs rm -rf")
-                       foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
+               if (! compat(5)) {
+                       complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf");
+               }
+               else {
+                       # Old broken code here for compatibility. Does not
+                       # remove everything.
+                       complex_doit("find $tmp -name $_ | xargs rm -rf")
+                               foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
+               }
        }
        if (! is_udeb($package)) {
                doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});