| 1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||
| 2 | # vim: ts=4 sts=4 sw=4: | ||
| 3 | package CPAN::Exception::blocked_urllist; | ||
| 4 | use strict; | ||
| 5 | use overload '""' => "as_string"; | ||
| 6 | |||
| 7 | use vars qw( | ||
| 8 | $VERSION | ||
| 9 | ); | ||
| 10 | $VERSION = "1.001"; | ||
| 11 | |||
| 12 | |||
| 13 | sub new { | ||
| 14 | my($class) = @_; | ||
| 15 | bless {}, $class; | ||
| 16 | } | ||
| 17 | |||
| 18 | sub as_string { | ||
| 19 | my($self) = shift; | ||
| 20 | if ($CPAN::Config->{connect_to_internet_ok}) { | ||
| 21 | return qq{ | ||
| 22 | |||
| 23 | You have not configured a urllist for CPAN mirrors. Configure it with | ||
| 24 | |||
| 25 | o conf init urllist | ||
| 26 | |||
| 27 | }; | ||
| 28 | } else { | ||
| 29 | return qq{ | ||
| 30 | |||
| 31 | You have not configured a urllist and do not allow connections to the | ||
| 32 | internet to get a list of mirrors. If you wish to get a list of CPAN | ||
| 33 | mirrors to pick from, use this command | ||
| 34 | |||
| 35 | o conf init connect_to_internet_ok urllist | ||
| 36 | |||
| 37 | If you do not wish to get a list of mirrors and would prefer to set | ||
| 38 | your urllist manually, use just this command instead | ||
| 39 | |||
| 40 | o conf init urllist | ||
| 41 | |||
| 42 | }; | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | 1; |