Make the HTML man page script a little better: effectively do a "mkdir
-p" when creating new directories. This commit was SVN r25921.
Этот коммит содержится в:
родитель
76d6bfe76a
Коммит
226c9af195
13
contrib/dist/make-html-man-pages.pl
поставляемый
13
contrib/dist/make-html-man-pages.pl
поставляемый
@ -36,6 +36,14 @@ sub absoluteize {
|
||||
return $dir;
|
||||
}
|
||||
|
||||
sub mkdir_p {
|
||||
my ($dir) = @_;
|
||||
if (!mkdir($dir)) {
|
||||
mkdir_p(dirname($dir));
|
||||
mkdir($dir) || die "Can't make directory $dir";
|
||||
}
|
||||
}
|
||||
|
||||
# Read command line arguments
|
||||
while (@ARGV) {
|
||||
my $a = $ARGV[0];
|
||||
@ -90,16 +98,15 @@ foreach my $file (@files) {
|
||||
my $name = $1;
|
||||
my $section = $2;
|
||||
|
||||
my $outfile = "$pwd/man$section/$b.php";
|
||||
# my $outdir = dirname($outfile);
|
||||
my $outdir = "$outdir_base/man$section";
|
||||
my $outfile = "$outdir/man$section/$b.php";
|
||||
$dirs{$outdir} = "";
|
||||
push(@{$outfiles->{$section}}, {
|
||||
name => $name,
|
||||
file => "man$section/$b.php",
|
||||
});
|
||||
|
||||
mkdir($outdir)
|
||||
mkdir_p($outdir)
|
||||
if (! -d $outdir);
|
||||
|
||||
print "*** Generating: $name ($section)\n";
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user