]> git.donarmstrong.com Git - debhelper.git/blob - dh_installdirs
r338: * Patch from Jorgen `forcer' Schaefer <forcer at mindless.com> (much
[debhelper.git] / dh_installdirs
1 #!/usr/bin/perl -w
2 #
3 # Reads debian/dirs, creates the directories listed there
4
5 use Debian::Debhelper::Dh_Lib;
6 init();
7
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
9         $TMP=tmpdir($PACKAGE);
10         $file=pkgfile($PACKAGE,"dirs");
11
12         if (! -e $TMP) {
13                 doit("install","-d",$TMP);
14         }
15
16         undef @dirs;
17
18         if ($file) {
19                 @dirs=filearray($file)
20         }
21
22         if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
23                 push @dirs, @ARGV;
24         }       
25
26         if (@dirs) {
27                 # Stick the $TMP onto the front of all the dirs.
28                 # This is necessary, for 2 reasons, one to make them 
29                 # be in the right directory, but more importantly, it 
30                 # protects against the danger of absolute dirs being
31                 # specified.
32                 @dirs=map {
33                                 $_="$TMP/$_";
34                                 tr:/:/:s; # just beautification.
35                                 $_
36                           } @dirs;
37
38                 # Create dirs.
39                 doit("install","-d",@dirs);
40         }
41 }