[debhelper-devel] [debhelper] 02/03: dh_prep: Bulk delete most files and dirs

Niels Thykier nthykier at moszumanska.debian.org
Sun Jun 4 14:13:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit a268022d265203f587ebe7bb0e577f9cc359e905
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Jun 4 13:43:30 2017 +0000

    dh_prep: Bulk delete most files and dirs
---
 debian/changelog |  6 +++---
 dh_prep          | 14 ++++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 22ad963..c9e329b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,9 +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.
+  * dh_clean, dh_prep: 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
diff --git a/dh_prep b/dh_prep
index 80b9dd3..16f479c 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<debhelper(7)>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list