From a268022d265203f587ebe7bb0e577f9cc359e905 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 4 Jun 2017 13:43:30 +0000 Subject: dh_prep: Bulk delete most files and dirs --- dh_prep | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'dh_prep') diff --git a/dh_prep b/dh_prep index 80b9dd38..16f479c8 100755 --- a/dh_prep +++ b/dh_prep @@ -40,24 +40,30 @@ multiple times to build up a list of things to exclude. init(); +my (@clean_files, @clean_dirs); + foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); - 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 # wildcard them. complex_doit("rm -f debian/$ext*.debhelper"); - doit('rm', '-rf', "debian/.debhelper/generated/${package}/"); - doit ("rm","-rf",$tmp."/") + push(@clean_dirs, "debian/.debhelper/generated/${package}/"); + push(@clean_dirs , "${tmp}/") unless excludefile($tmp); } -doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && +push(@clean_dirs, 'debian/tmp') if -x 'debian/tmp' && ! excludefile("debian/tmp"); + +xargs(\@clean_files, 'rm', '-f', '--') if @clean_files; +xargs(\@clean_dirs, 'rm', '-fr', '--') if @clean_dirs; + =head1 SEE ALSO L -- cgit v1.2.3