From: Richard Levitte Date: Wed, 5 Jun 2002 14:10:31 +0000 (+0000) Subject: Make perl replacement for dirname, for system that lack the latter. X-Git-Tag: OpenSSL_0_9_7-beta2~30 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ed703912b2f6e5211f4a91f46f14898b84e006f7;p=oweals%2Fopenssl.git Make perl replacement for dirname, for system that lack the latter. PR: 81 --- diff --git a/Makefile.org b/Makefile.org index 3ed232fcf9..a43d3f8b1e 100644 --- a/Makefile.org +++ b/Makefile.org @@ -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`") \ diff --git a/util/dirname.pl b/util/dirname.pl new file mode 100644 index 0000000000..d7a66d96ac --- /dev/null +++ b/util/dirname.pl @@ -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);