Skip to content

Commit 2865467

Browse files
avargitster
authored andcommitted
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 20d2a30 ("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 8b9150e ("Git.pm: Handle failed commands' output", 2006-06-24). Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 10cf3b0 commit 2865467

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

contrib/examples/git-difftool.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use 5.008;
1414
use strict;
1515
use warnings;
16-
use Git::Error qw(:try);
16+
use Git::LoadCPAN::Error qw(:try);
1717
use File::Basename qw(dirname);
1818
use File::Copy;
1919
use File::Find;

git-send-email.perl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
use Term::ANSIColor;
2727
use File::Temp qw/ tempdir tempfile /;
2828
use File::Spec::Functions qw(catdir catfile);
29-
use Git::Error qw(:try);
29+
use Git::LoadCPAN::Error qw(:try);
3030
use Cwd qw(abs_path cwd);
3131
use Git;
3232
use Git::I18N;
33-
use Git::Mail::Address;
3433
use Net::Domain ();
3534
use Net::SMTP ();
35+
use Git::LoadCPAN::Mail::Address;
3636

3737
Getopt::Long::Configure qw/ pass_through /;
3838

perl/Git.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ increase notwithstanding).
104104

105105

106106
use Carp qw(carp croak); # but croak is bad - throw instead
107-
use Git::Error qw(:try);
107+
use Git::LoadCPAN::Error qw(:try);
108108
use Cwd qw(abs_path cwd);
109109
use IPC::Open2 qw(open2);
110110
use Fcntl qw(SEEK_SET SEEK_CUR);

perl/Git/Error.pm renamed to perl/Git/LoadCPAN/Error.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package Git::Error;
1+
package Git::LoadCPAN::Error;
22
use 5.008;
33
use strict;
44
use warnings;
55

66
=head1 NAME
77
8-
Git::Error - Wrapper for the L<Error> module, in case it's not installed
8+
Git::LoadCPAN::Error - Wrapper for the L<Error> module, in case it's not installed
99
1010
=head1 DESCRIPTION
1111
@@ -26,13 +26,13 @@ sub import {
2626
} or do {
2727
my $error = $@ || "Zombie Error";
2828

29-
my $Git_Error_pm_path = $INC{"Git/Error.pm"} || die "BUG: Should have our own path from %INC!";
29+
my $Git_Error_pm_path = $INC{"Git/LoadCPAN/Error.pm"} || die "BUG: Should have our own path from %INC!";
3030

3131
require File::Basename;
3232
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'!";
3333

3434
require File::Spec;
35-
my $Git_pm_FromCPAN_root = File::Spec->catdir($Git_Error_pm_root, 'FromCPAN');
35+
my $Git_pm_FromCPAN_root = File::Spec->catdir($Git_Error_pm_root, '..', 'FromCPAN');
3636
die "BUG: '$Git_pm_FromCPAN_root' should be a directory!" unless -d $Git_pm_FromCPAN_root;
3737

3838
local @INC = ($Git_pm_FromCPAN_root, @INC);

perl/Git/Mail/Address.pm renamed to perl/Git/LoadCPAN/Mail/Address.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package Git::Mail::Address;
1+
package Git::LoadCPAN::Mail::Address;
22
use 5.008;
33
use strict;
44
use warnings;
55

66
=head1 NAME
77
8-
Git::Mail::Address - Wrapper for the L<Mail::Address> module, in case it's not installed
8+
Git::LoadCPAN::Mail::Address - Wrapper for the L<Mail::Address> module, in case it's not installed
99
1010
=head1 DESCRIPTION
1111

0 commit comments

Comments
 (0)