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
> this permanently which is just cumbersome. It would, IMHO, make sense to 
> change
> the default to http://paste.debian.net as it is the pastebin most closely
> associated with Debian.
> 
> Thanks and may you have a nice day!

First of all thanks for using nopaste and submitting this bugreport.
Apologies that you did not get a reply earlier.

I have looked at your request. I think something like the attached
patch would do it. *But*, I'm unsure it is a good idea.

On one side we would need to refresh/update always Nopaste.pm if there
is achange and keep our patch in sync. This is not a big deal if the
attached works.

But the second is that this affects e.g. Ubuntu as downstream. They
will now then also be forced to use paste.debian.net unless too
patched.

Are there opinion from others from the Debian Perl Group on this?

Regards,
Salvatore
From 4721f187a885621cea13b5724a185baee29a9db1 Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <[email protected]>
Date: Sun, 16 Sep 2012 00:46:46 +0200
Subject: [PATCH] Default to App::Nopaste::Service::Debian service

Defaults to App::Nopaste::Service::Debian service if neither services is
passes as argument to nopaste nor NOPASTE_SERVICES environment variable
is set.
---
 lib/App/Nopaste.pm |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/App/Nopaste.pm b/lib/App/Nopaste.pm
index defe678..543026a 100755
--- a/lib/App/Nopaste.pm
+++ b/lib/App/Nopaste.pm
@@ -22,9 +22,10 @@ sub nopaste {
     # everything else
     my %args = @_;
 
-    $args{services} = defined($ENV{NOPASTE_SERVICES})
-                   && [split ' ', $ENV{NOPASTE_SERVICES}]
-                        if !defined($args{services});
+     $args{services} = defined($args{services})        ? $args{services}
+                     : defined($ENV{NOPASTE_SERVICES}) ? [split ' ', $ENV{NOPASTE_SERVICES}]
+                     :                                   [ 'App::Nopaste::Service::Debian' ]
+                     ;
 
     $args{nick} = $ENV{NOPASTE_NICK} || $ENV{USER}
         if !defined($args{nick});
-- 
1.7.10.4

Attachment: signature.asc
Description: Digital signature

Reply via email to