[debhelper-devel] [debhelper] 04/06: dh_fixperms: Extract a list of chmod -R a+x dirs

Niels Thykier nthykier at moszumanska.debian.org
Mon Apr 17 17:07:04 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 3a97a2039b1c9a902a78c41963a292a96abae335
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Apr 17 16:38:03 2017 +0000

    dh_fixperms: Extract a list of chmod -R a+x dirs
    
    Should also assist DilOS and other derivatives by moving the list out
    of the code logic.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_fixperms | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dh_fixperms b/dh_fixperms
index f364dd6..6c782a2 100755
--- a/dh_fixperms
+++ b/dh_fixperms
@@ -53,6 +53,9 @@ sub patterns2find_expr {
 
 my $vendorlib = substr $Config{vendorlib}, 1;
 my $vendorarch = substr $Config{vendorarch}, 1;
+my @executable_files_dirs = (
+	qw{usr/bin bin usr/sbin sbin usr/games etc/init.d},
+);
 my @mode_0644_patterns = (
 	# Libraries and related files
 	'*.so.*', '*.so', '*.la', '*.a',
@@ -116,12 +119,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	find_and_reset_perm($tmp, '0644', "-type f ${mode_0644_find_pattern}");
 	
 	# Programs in the bin and init.d dirs should be executable..
-	for my $dir (qw{usr/bin bin usr/sbin sbin usr/games etc/init.d}) {
-		if (-d "$tmp/$dir") {
-			complex_doit("find ${tmp}/${dir} -type f ${find_exclude_options} -print0 2>/dev/null",
-				"| xargs -0r chmod a+x");
-		}
-	}
+	find_and_reset_perm([map { "${tmp}/$_"} @executable_files_dirs], 'a+x', '-type f');
 	
 	# ADA ali files should be mode 444 to avoid recompilation
 	find_and_reset_perm("${tmp}/usr/lib", 'uga-w', "-type f -name '*.ali'");

-- 
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