#!/usr/bin/perl -w =head1 NAME dh_clifixperms - fix permissions of files in CLI package build directories =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-X>I] =head1 DESCRIPTION dh_clifixperms is a debhelper program that is responsible for setting the permissions of files and directories for CLI assemblies and executables. dh_clifixperms makes all files that end in *.dll, *.mdb, *.cs, *.aspx, and *.config to mode 644 and *.exe to mode 755. =head1 OPTIONS =over 4 =item B<-X>I, B<--exclude> I Exclude files that contain "item" anywhere in their filename from having their permissions changed. You may use this option multiple times to build up a list of things to exclude. =back =cut init(); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $find_options=''; if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; } # Fix the permissions of various CLI-based files for my $ext (qw(dll mdb cs config aspx)) { complex_doit("find $tmp $find_options -name \"*.$ext\" -type f -print0", "2>/dev/null | xargs -0r chmod 0644"); } complex_doit("find $tmp $find_options -name \"*.exe\" -type f -print0", "2>/dev/null | xargs -0r chmod 0755"); } =head1 SEE ALSO L This program is a part of cli-common. =head1 AUTHOR Dylan R. E. Moonfire based on work from Joey Hess . =cut