diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2018-03-03 15:38:13 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-05 10:52:28 -0800 |
commit | 28654678cff4c7b78f87a6768a896d76a1784d45 (patch) | |
tree | f970118f54a08e81404a82f5cf2abe4a026aa647 /perl/Git | |
parent | 10cf3b076da31320108ad16bc3695a5e6a4600b0 (diff) | |
download | git-28654678cff4c7b78f87a6768a896d76a1784d45.tar.gz |
perl: move CPAN loader wrappers to another namespace
Move the Git::Error and Git::Mail::Address wrappers to the
Git::LoadCPAN::Loader::* namespace, e.g. Git::LoadCPAN::Error. That
module will then either load Error from CPAN (if installed on the OS),
or use Git::FromCPAN::Error.
When I added the Error wrapper in 20d2a30f8f ("Makefile: replace
perl/Makefile.PL with simple make rules", 2017-12-10) I didn't think
about how confusing it would be to have these modules sitting in the
same tree as our normal modules. Let's put these all into
Git::{Load,From}CPAN::* to clearly distinguish them from the rest.
This also makes things a bit less confusing since there was already a
Git::Error namespace ever since 8b9150e3e3 ("Git.pm: Handle failed
commands' output", 2006-06-24).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'perl/Git')
-rw-r--r-- | perl/Git/LoadCPAN/Error.pm (renamed from perl/Git/Error.pm) | 8 | ||||
-rw-r--r-- | perl/Git/LoadCPAN/Mail/Address.pm (renamed from perl/Git/Mail/Address.pm) | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/perl/Git/Error.pm b/perl/Git/LoadCPAN/Error.pm index 09bbc97390..3513fe745b 100644 --- a/perl/Git/Error.pm +++ b/perl/Git/LoadCPAN/Error.pm @@ -1,11 +1,11 @@ -package Git::Error; +package Git::LoadCPAN::Error; use 5.008; use strict; use warnings; =head1 NAME -Git::Error - Wrapper for the L<Error> module, in case it's not installed +Git::LoadCPAN::Error - Wrapper for the L<Error> module, in case it's not installed =head1 DESCRIPTION @@ -26,13 +26,13 @@ sub import { } or do { my $error = $@ || "Zombie Error"; - my $Git_Error_pm_path = $INC{"Git/Error.pm"} || die "BUG: Should have our own path from %INC!"; + my $Git_Error_pm_path = $INC{"Git/LoadCPAN/Error.pm"} || die "BUG: Should have our own path from %INC!"; require File::Basename; my $Git_Error_pm_root = File::Basename::dirname($Git_Error_pm_path) || die "BUG: Can't figure out lib/Git dirname from '$Git_Error_pm_path'!"; require File::Spec; - my $Git_pm_FromCPAN_root = File::Spec->catdir($Git_Error_pm_root, 'FromCPAN'); + my $Git_pm_FromCPAN_root = File::Spec->catdir($Git_Error_pm_root, '..', 'FromCPAN'); die "BUG: '$Git_pm_FromCPAN_root' should be a directory!" unless -d $Git_pm_FromCPAN_root; local @INC = ($Git_pm_FromCPAN_root, @INC); diff --git a/perl/Git/Mail/Address.pm b/perl/Git/LoadCPAN/Mail/Address.pm index 2ce3e84670..879c2f5cd1 100644 --- a/perl/Git/Mail/Address.pm +++ b/perl/Git/LoadCPAN/Mail/Address.pm @@ -1,11 +1,11 @@ -package Git::Mail::Address; +package Git::LoadCPAN::Mail::Address; use 5.008; use strict; use warnings; =head1 NAME -Git::Mail::Address - Wrapper for the L<Mail::Address> module, in case it's not installed +Git::LoadCPAN::Mail::Address - Wrapper for the L<Mail::Address> module, in case it's not installed =head1 DESCRIPTION |