From: Richard Levitte Date: Wed, 5 Jun 2002 14:10:59 +0000 (+0000) Subject: Make perl replacement for dirname, for system that lack the latter. X-Git-Tag: OpenSSL_0_9_6e~26^2~95 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d13363af6040e8f1277b984719c937ba55e52c41;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 8a767e2a30..8303f2ce8a 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);