diff options
author | Anton Berezin <tobez@FreeBSD.org> | 2002-06-16 12:40:13 +0000 |
---|---|---|
committer | Anton Berezin <tobez@FreeBSD.org> | 2002-06-16 12:40:13 +0000 |
commit | c482b493ebd7abb0e5b9725336195a24d53e2e3a (patch) | |
tree | ef455bafbe66d108f833f61613107e60c90cad9a /lang/perl5 | |
parent | 5596d333922cde4af97af5ffdcb6af3eae01e4ab (diff) | |
download | ports-c482b493ebd7abb0e5b9725336195a24d53e2e3a.tar.gz ports-c482b493ebd7abb0e5b9725336195a24d53e2e3a.zip |
Notes
Diffstat (limited to 'lang/perl5')
-rw-r--r-- | lang/perl5/files/use.perl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lang/perl5/files/use.perl b/lang/perl5/files/use.perl index 7769cdd49d77..bed88bd46d44 100644 --- a/lang/perl5/files/use.perl +++ b/lang/perl5/files/use.perl @@ -109,15 +109,22 @@ NO_PERL_WRAPPER=yo EOF close MK; - open MPOLD, "< /etc/manpath.config" or die "/etc/manpath.config: $!"; - open MPNEW, "> /etc/manpath.config.new" or die "/etc/manpath.config.new: $!"; - while (<MPOLD>) { - print MPNEW <<EOF if m|^\s*OPTIONAL_MANPATH\s+\S+/lib/perl5/\S+/man\s*$|; + my $perl_port_manpath = <<EOF; # -- use.perl generated line -- # OPTIONAL_MANPATH %%PREFIX%%/lib/perl5/%%PERL_VERSION%%/man EOF + + open MPOLD, "< /etc/manpath.config" or die "/etc/manpath.config: $!"; + open MPNEW, "> /etc/manpath.config.new" or die "/etc/manpath.config.new: $!"; + my $modified = 0; + while (<MPOLD>) { + if (!$modified && m|^\s*OPTIONAL_MANPATH\s+\S+/lib/perl5/\S+/man\s*$|) { + print MPNEW $perl_port_manpath; + $modified = 1; + } print MPNEW; } + print MPNEW $perl_port_manpath unless $modified; close MPNEW; close MPOLD; rename '/etc/manpath.config', '/etc/manpath.config.bak'; |