[devscripts] 04/05: debsnap: Use core Perl JSON::PP module

James McCoy jamessan at debian.org
Wed Feb 3 03:30:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit 0c419b532fffb5f171d8315ab7853a85817747c6
Author: James McCoy <jamessan at debian.org>
Date:   Tue Feb 2 22:00:43 2016 -0500

    debsnap: Use core Perl JSON::PP module
    
    This allows dropping a dependency needed to run debsnap.
    
    Closes: #803315
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog   |  3 +++
 debian/control     |  4 +---
 scripts/debsnap.pl | 14 ++------------
 3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1e59359..aadfde8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,9 @@ devscripts (2.16.1) UNRELEASED; urgency=medium
   * dcmd:
     + Support .buildinfo files.  Thanks to Johannes Schauer for the patch.
       (Closes: #774554)
+  * debsnap:
+    + Remove use of JSON module in favor of the core Perl JSON::PP module.
+      Thanks to RjY and Jakub Wilk.  (Closes: #803315)
 
   [ Christoph Berg ]
   * debcheckout: Add auth mapping for https://github.com.
diff --git a/debian/control b/debian/control
index 0da60b8..07aab3e 100644
--- a/debian/control
+++ b/debian/control
@@ -59,7 +59,6 @@ Recommends: apt,
             gnupg | gnupg2,
             libdistro-info-perl,
             libencode-locale-perl,
-            libjson-perl,
             liburi-perl,
             libwww-perl,
             lintian,
@@ -145,8 +144,7 @@ Description: scripts to make the life of a Debian Package maintainer easier
     the rest of the package to be present; can sign the pair remotely
     or fetch the pair from a remote machine for signing [gnupg | gnupg2,
     debian-keyring, ssh-client]
-  - debsnap: grab packages from http://snapshot.debian.org [libwww-perl,
-    libjson-perl]
+  - debsnap: grab packages from http://snapshot.debian.org [libwww-perl]
   - debuild: wrapper to build a package without having to su or worry
     about how to invoke dpkg to build using fakeroot.  Also deals
     with common environment problems, umask etc. [fakeroot, lintian,
diff --git a/scripts/debsnap.pl b/scripts/debsnap.pl
index c6b07e3..bbad0c2 100755
--- a/scripts/debsnap.pl
+++ b/scripts/debsnap.pl
@@ -23,6 +23,7 @@ use File::Basename;
 use Cwd qw/cwd abs_path/;
 use File::Path qw/make_path/;
 use Dpkg::Version;
+use JSON::PP;
 
 my $progname = basename($0);
 
@@ -41,17 +42,6 @@ if ($@) {
     }
 }
 
-eval {
-    require JSON;
-};
-if ($@) {
-    if ($@ =~ m/Can\'t locate JSON/) {
-	die "$progname: Unable to run: the libjson-perl package is not installed";
-    } else {
-	die "$progname: Unable to run: Couldn't load JSON: $@";
-    }
-}
-
 my $modified_conf_msg = '';
 my %config_vars = ();
 
@@ -114,7 +104,7 @@ sub fetch_json_page
     verbose "Getting json $json_url\n";
     my $content = LWP::Simple::get($json_url);
     return unless defined $content;
-    my $json = JSON->new();
+    my $json = JSON::PP->new();
 
     # these are some nice json options to relax restrictions a bit:
     my $json_text = $json->allow_nonref->utf8->relaxed->decode($content);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list