summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-05-01 09:25:24 +0000
committerjoe <joe@FreeBSD.org>2001-05-01 09:25:24 +0000
commitef9fe039e77f3c91a27397323de8febd10d089b5 (patch)
tree169dde24593657aefab66a3c192effea65c404f6 /gnu
parentddbd7bc71816cd2cac9d1b39240e4fdd57acbf48 (diff)
downloadFreeBSD-src-ef9fe039e77f3c91a27397323de8febd10d089b5.zip
FreeBSD-src-ef9fe039e77f3c91a27397323de8febd10d089b5.tar.gz
* Add Config.pm to fight situations when perldoc(1) showed a manual page
for a module overridden by BSDPAN instead of the original module. * Fix wrong manual section numbers in SEE ALSO. * Add `Revision 42' to the beer-ware license. The BSDPAN author did not originally get the reference and removed the revision from original phk's version. Submitted by: Anton Berezin <tobez@tobez.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/perl/BSDPAN/BSDPAN.pm6
-rw-r--r--gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm4
-rw-r--r--gnu/usr.bin/perl/BSDPAN/Config.pm84
-rw-r--r--gnu/usr.bin/perl/BSDPAN/ExtUtils/MM_Unix.pm4
-rw-r--r--gnu/usr.bin/perl/BSDPAN/ExtUtils/Packlist.pm4
-rw-r--r--gnu/usr.bin/perl/BSDPAN/Makefile2
6 files changed, 94 insertions, 10 deletions
diff --git a/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm b/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm
index 0ce6bbc..8b9e3f3 100644
--- a/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm
+++ b/gnu/usr.bin/perl/BSDPAN/BSDPAN.pm
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# "THE BEER-WARE LICENSE"
+# "THE BEER-WARE LICENSE" (Revision 42)
# <tobez@tobez.org> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Anton Berezin
@@ -113,7 +113,7 @@ Anton Berezin, tobez@tobez.org
=head1 SEE ALSO
-perl(1), ExtUtils::MakeMaker(1), L<BSDPAN::Override(1)>,
-L<BSDPAN::ExtUtils::MM_Unix(1)>, L<BSDPAN::ExtUtils::Packlist(1)>.
+perl(1), ExtUtils::MakeMaker(3), L<BSDPAN::Override(3)>,
+L<BSDPAN::ExtUtils::MM_Unix(3)>, L<BSDPAN::ExtUtils::Packlist(3)>.
=cut
diff --git a/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm b/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm
index c11cd7a..10dc2d6 100644
--- a/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm
+++ b/gnu/usr.bin/perl/BSDPAN/BSDPAN/Override.pm
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# "THE BEER-WARE LICENSE"
+# "THE BEER-WARE LICENSE" (Revision 42)
# <tobez@tobez.org> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Anton Berezin
@@ -148,6 +148,6 @@ Anton Berezin, tobez@tobez.org
=head1 SEE ALSO
-perl(1), L<BSDPAN(1)>.
+perl(1), L<BSDPAN(3)>.
=cut
diff --git a/gnu/usr.bin/perl/BSDPAN/Config.pm b/gnu/usr.bin/perl/BSDPAN/Config.pm
new file mode 100644
index 0000000..6391eb7
--- /dev/null
+++ b/gnu/usr.bin/perl/BSDPAN/Config.pm
@@ -0,0 +1,84 @@
+# ----------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42)
+# <tobez@tobez.org> wrote this file. As long as you retain this notice you
+# can do whatever you want with this stuff. If we meet some day, and you think
+# this stuff is worth it, you can buy me a beer in return. Anton Berezin
+# ----------------------------------------------------------------------------
+#
+# $FreeBSD$
+#
+package BSDPAN::Config;
+
+use strict;
+use BSDPAN;
+
+sub bsdpan_no_override
+{
+ my $bsdpan_path = BSDPAN->path;
+ my @ninc;
+ for my $inc_component (@INC) {
+ push @ninc, $inc_component
+ unless $inc_component eq $bsdpan_path;
+ }
+ @INC = (@ninc, $bsdpan_path);
+}
+
+BEGIN {
+ if ($0 =~ m|/bin/perldoc$|) {
+ bsdpan_no_override();
+
+ # Also, add bsdpan_path/.. to @INC, so that perldoc
+ # BSDPAN::ExtUtils::MM_Unix and friends will work as
+ # expected.
+
+ push @INC, BSDPAN->path() . "/..";
+ }
+}
+use BSDPAN::Override;
+
+1;
+=head1 NAME
+
+BSDPAN::Config - disable BSDPAN functionality if needed
+
+=head1 SYNOPSIS
+
+ None
+
+=head1 DESCRIPTION
+
+When perldoc(1) is invoked, this module:
+
+=over 4
+
+=item *
+
+Moves the path to BSDPAN(3) from the beginning of @INC to the end of
+@INC.
+
+=item *
+
+Adds the parent directory of the path to BSDPAN(3) to the end of @INC,
+so that
+
+ perldoc BSDPAN::Some::Module::BSDPAN::Overrides
+
+does the right thing.
+
+=back
+
+This modules has no other effects.
+
+=head1 AUTHOR
+
+Anton Berezin, tobez@tobez.org
+
+=head1 SEE ALSO
+
+perl(1), L<BSDPAN(3)>, L<BSDPAN::Override(3)>, perldoc(1).
+
+=head1 BUGS
+
+This module is a hack.
+
+=cut
diff --git a/gnu/usr.bin/perl/BSDPAN/ExtUtils/MM_Unix.pm b/gnu/usr.bin/perl/BSDPAN/ExtUtils/MM_Unix.pm
index 5bfcf59..c60b782 100644
--- a/gnu/usr.bin/perl/BSDPAN/ExtUtils/MM_Unix.pm
+++ b/gnu/usr.bin/perl/BSDPAN/ExtUtils/MM_Unix.pm
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# "THE BEER-WARE LICENSE"
+# "THE BEER-WARE LICENSE" (Revision 42)
# <tobez@tobez.org> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Anton Berezin
@@ -107,6 +107,6 @@ Anton Berezin, tobez@tobez.org
=head1 SEE ALSO
-perl(1), L<BSDPAN(1)>, L<BSDPAN::Override(1)>, ports(7).
+perl(1), L<BSDPAN(3)>, L<BSDPAN::Override(3)>, ports(7).
=cut
diff --git a/gnu/usr.bin/perl/BSDPAN/ExtUtils/Packlist.pm b/gnu/usr.bin/perl/BSDPAN/ExtUtils/Packlist.pm
index 24a39a9..d9302d0 100644
--- a/gnu/usr.bin/perl/BSDPAN/ExtUtils/Packlist.pm
+++ b/gnu/usr.bin/perl/BSDPAN/ExtUtils/Packlist.pm
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# "THE BEER-WARE LICENSE"
+# "THE BEER-WARE LICENSE" (Revision 42)
# <tobez@tobez.org> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Anton Berezin
@@ -332,6 +332,6 @@ Anton Berezin, tobez@tobez.org
=head1 SEE ALSO
-perl(1), L<BSDPAN(1)>, L<BSDPAN::Override(1)>, pkg_create(1).
+perl(1), L<BSDPAN(3)>, L<BSDPAN::Override(3)>, pkg_create(1).
=cut
diff --git a/gnu/usr.bin/perl/BSDPAN/Makefile b/gnu/usr.bin/perl/BSDPAN/Makefile
index b0b5e55..701712f 100644
--- a/gnu/usr.bin/perl/BSDPAN/Makefile
+++ b/gnu/usr.bin/perl/BSDPAN/Makefile
@@ -8,7 +8,7 @@ NOOBJ= noobj
all clean cleandir depend lint tags:
-FILES= BSDPAN.pm BSDPAN/Override.pm ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
.for file in ${FILES}
beforeinstall::
OpenPOWER on IntegriCloud