summaryrefslogtreecommitdiff
path: root/dh_clifixperms
diff options
context:
space:
mode:
authorDylan R. E. Moonfire <debian@mfgames.com>2006-07-21 00:44:30 +0000
committerDylan R. E. Moonfire <debian@mfgames.com>2006-07-21 00:44:30 +0000
commit23dcf190859ed6c28eb771cc1942d4559a492cc2 (patch)
tree84568d6409d0ab95a1fe32466be8d1ba62be7642 /dh_clifixperms
parent15dd13692788879c60d756be12bda15640e8fb74 (diff)
Added a dh_clifixperms script that handles the permission
manipulation common to all CLI packages.
Diffstat (limited to 'dh_clifixperms')
-rwxr-xr-xdh_clifixperms68
1 files changed, 68 insertions, 0 deletions
diff --git a/dh_clifixperms b/dh_clifixperms
new file mode 100755
index 0000000..f016c86
--- /dev/null
+++ b/dh_clifixperms
@@ -0,0 +1,68 @@
+#!/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<dh_clifixperms> [S<I<debhelper options>>] [B<-X>I<item>]
+
+=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 *.exe, *.dll, *.mdb, *.cs,
+*.aspx, and *.config to mode 644.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-X>I<item>, B<--exclude> I<item>
+
+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 exe aspx))
+ {
+ complex_doit("find $tmp $find_options -name \"*.$ext\" -print0",
+ "2>/dev/null | xargs -0r chmod 0644");
+ }
+}
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+This program is a part of cli-common.
+
+=head1 AUTHOR
+
+Dylan R. E. Moonfire <debian@mfgames.com> based on work from Joey Hess
+<joeyh@debian.org>.
+
+=cut