Make perl replacement for dirname, for system that lack the latter.

PR: 81
This commit is contained in:
Richard Levitte 2002-06-05 14:10:59 +00:00
parent b6fc2386f0
commit d13363af60
2 changed files with 20 additions and 2 deletions

View File

@ -732,7 +732,7 @@ install_docs:
fn=`basename $$i .pod`; \
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
(cd `dirname $$i`; \
(cd `$(PERL) util/dirname.pl $$i`; \
sh -c "`cd ../../util; ./pod2mantest ignore` \
--section=$$sec --center=OpenSSL \
--release=$(VERSION) `basename $$i`") \
@ -742,7 +742,7 @@ install_docs:
fn=`basename $$i .pod`; \
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
(cd `dirname $$i`; \
(cd `$(PERL) util/dirname.pl $$i`; \
sh -c "`cd ../../util; ./pod2mantest ignore` \
--section=$$sec --center=OpenSSL \
--release=$(VERSION) `basename $$i`") \

18
util/dirname.pl Normal file
View File

@ -0,0 +1,18 @@
#!/usr/local/bin/perl
if ($#ARGV < 0) {
die "dirname.pl: too few arguments\n";
} elsif ($#ARGV > 0) {
die "dirname.pl: too many arguments\n";
}
my $d = $ARGV[0];
if ($d =~ m|.*/.*|) {
$d =~ s|/[^/]*$||;
} else {
$d = ".";
}
print $d,"\n";
exit(0);