diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | dh_clean | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index aa11c070..f6d55432 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,9 @@ debhelper (10.5) UNRELEASED; urgency=medium override targets to be ignored. Thanks to Gianfranco Costamagna for reporting it and Iain Lane for tracing it to the commit that introduced the issue. (Closes: #863887) + * dh_clean: Bulk delete most files and directories, which gives a + noticable speed up for source packages building many binary + packages. [ Iain Lane ] * Dh_Lib: Re-add warning + exit 0 for the -i/-a shortcut that was @@ -88,12 +88,14 @@ if ($dh{K_FLAG}) { # Remove the debhelper stamp file doit('rm', '-f', 'debian/debhelper-build-stamp') if not $dh{D_FLAG}; +my (@clean_files, @clean_dirs); + foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); if (! $dh{D_FLAG}) { - doit("rm","-f","debian/${ext}substvars") + push(@clean_files, "debian/${ext}substvars") unless excludefile("debian/${ext}substvars"); # These are all debhelper temp files, and so it is safe to @@ -101,7 +103,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { complex_doit("rm -f debian/$ext*.debhelper"); } - doit ("rm","-rf",$tmp."/") + push(@clean_dirs , "${tmp}/") unless excludefile($tmp); } @@ -121,7 +123,6 @@ if (! $dh{D_FLAG} && ! $dh{K_FLAG}) { } if (! $dh{D_FLAG}) { - my (@clean_files, @clean_dirs); if (@ARGV) { push(@clean_files, grep { !m@/$@ } @ARGV); push(@clean_dirs, grep { m@/$@ } @ARGV); @@ -135,13 +136,15 @@ if (! $dh{D_FLAG}) { push(@clean_dirs, grep { m@/$@ } @clean); } - doit("rm","-f","debian/files") + push(@clean_files, 'debian/files') unless excludefile("debian/files"); } +} - doit('rm', '-f', '--', @clean_files) if @clean_files; - doit('rm', '-fr', '--', @clean_dirs) if @clean_dirs; +xargs(\@clean_files, 'rm', '-f', '--') if @clean_files; +xargs(\@clean_dirs, 'rm', '-fr', '--') if @clean_dirs; +if (! $dh{D_FLAG}) { # See if some files that would normally be deleted are excluded. my $find_options=''; if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { |