Bug#675228: Use http://paste.debian.net by default
Salvatore Bonaccorso
carnil at debian.org
Sun Sep 16 11:43:46 UTC 2012
Hi Damyan
Thanks for looking at it too!
On Sun, Sep 16, 2012 at 10:14:28AM +0300, Damyan Ivanov wrote:
> -=| Salvatore Bonaccorso, 16.09.2012 00:54:45 +0200 |=-
> > Hi Wolodja
> >
> > On Wed, May 30, 2012 at 05:12:13PM +0100, Wolodja Wentland wrote:
> > > Package: libapp-nopaste-perl
> > > Version: 0.33-1
> > > Severity: wishlist
> > >
> > > nopaste currently uploads pastes to http://pastie.org by default. Users have
> > > to set the NOPASTE_SERVICES environment variable to 'Debian' in order to change
>
> I looked in the code and I couldn't find where this default comes
> from. To me it seems that all available services are tried in turn, in
> the order they are returned by the file system (via File::Find, used
> by Module::Pluggable).
Only one addition to this. If no service is set via environment
variable or argument then we get the list of all plugins first in
(lib/App/Nopaste.pm):
33 my $using_default = 0;
34 unless (ref($args{services}) eq 'ARRAY' && @{$args{services}}) {
35 $using_default = 1;
36 $args{services} = [ $self->plugins ];
37 }
The selection of the first service then happens in
51 # try to paste to each service in order
52 for my $service (@{ $args{services} }) {
53 $service = "App::Nopaste::Service::$service"
54 unless $service =~ /^App::Nopaste::Service/;
55
56 no warnings 'exiting';
57 my @ret = eval {
58
59 local $SIG{__WARN__} = sub {
60 $args{warn_handler}->($_[0], $service);
61 } if $args{warn_handler};
62
63 load_class($service);
64
65 next unless $service->available(%args);
66 next if $using_default && $service->forbid_in_default;
67 $service->nopaste(%args);
68 };
where the services are skipped either if they mark itself as 'not
available' (by setting "sub available { 0 }" in the module?) or are
forbidden as defaults (by setting "sub forbid_in_default { 1 }" in the
Plugin itself).
Regards,
Salvatore
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20120916/ba8247db/attachment-0001.pgp>
More information about the pkg-perl-maintainers
mailing list