summaryrefslogtreecommitdiff
path: root/perl/Git/LoadCPAN/Mail
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2018-03-03 15:38:13 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-05 10:52:28 -0800
commit28654678cff4c7b78f87a6768a896d76a1784d45 (patch)
treef970118f54a08e81404a82f5cf2abe4a026aa647 /perl/Git/LoadCPAN/Mail
parentperl: update our copy of Mail::Address (diff)
downloadtgif-28654678cff4c7b78f87a6768a896d76a1784d45.tar.xz
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/LoadCPAN/Mail')
-rw-r--r--perl/Git/LoadCPAN/Mail/Address.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/perl/Git/LoadCPAN/Mail/Address.pm b/perl/Git/LoadCPAN/Mail/Address.pm
new file mode 100644
index 0000000000..879c2f5cd1
--- /dev/null
+++ b/perl/Git/LoadCPAN/Mail/Address.pm
@@ -0,0 +1,24 @@
+package Git::LoadCPAN::Mail::Address;
+use 5.008;
+use strict;
+use warnings;
+
+=head1 NAME
+
+Git::LoadCPAN::Mail::Address - Wrapper for the L<Mail::Address> module, in case it's not installed
+
+=head1 DESCRIPTION
+
+This module is only intended to be used for code shipping in the
+C<git.git> repository. Use it for anything else at your peril!
+
+=cut
+
+eval {
+ require Mail::Address;
+ 1;
+} or do {
+ require Git::FromCPAN::Mail::Address;
+};
+
+1;