[pkg-perl-tools] 01/01: add script to install dzil author dependencies

dod at debian.org dod at debian.org
Wed Dec 7 19:36:19 UTC 2016


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

dod pushed a commit to branch master
in repository pkg-perl-tools.

commit 46419437c5da61279429c964d89fb348d42721d7
Author: Dominique Dumont <dod at debian.org>
Date:   Wed Dec 7 20:33:13 2016 +0100

    add script to install dzil author dependencies
    
    This will greatly help simplify config::model's README.build-from-git
    instructions.
---
 scripts/install-dzil-deps | 87 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/scripts/install-dzil-deps b/scripts/install-dzil-deps
new file mode 100644
index 0000000..92490ce
--- /dev/null
+++ b/scripts/install-dzil-deps
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+
+#    Copyright  & Licensing at the end
+
+use strict;
+use warnings;
+use 5.010;
+
+
+use Debian::AptContents;
+use DhMakePerl::Utils qw(is_core_module);
+use Dist::Zilla::Util::AuthorDeps;
+
+my $apt_contents = Debian::AptContents->new( { homedir => $ENV{'HOME'}.'/.dh-make-perl' } );
+
+unless ($apt_contents) {
+    die <<EOF;
+Unable to locate module packages, because APT Contents files
+are not available on the system.
+
+Install the 'apt-file' package, run 'apt-file update' as root
+and retry.
+EOF
+}
+
+my $dep_list = Dist::Zilla::Util::AuthorDeps::extract_author_deps('.',1);
+
+if (not @$dep_list ) {
+    say "All dzil dependencies are already available";
+    exit;
+}
+
+my @pkgs;
+foreach my $dep (@$dep_list) {
+    my ($mod, $version) = %$dep;
+    if ( my $pkg = $apt_contents->find_perl_module_package($mod) ) {
+        say "$mod is in $pkg package";
+        push @pkgs , $pkg;
+    }
+    else {
+        warn "$mod is not found in any Debian package\n";
+    }
+}
+
+if (@pkgs) {
+    say "Installing required packages...";
+    system(qw/sudo apt-get install/, at pkgs);
+}
+
+
+
+1;
+
+__END__
+
+=head1 NAME
+
+dpt-install-dzil-deps -- Install Dist::Zilla authors dependencies
+
+=head1 SYNOPSIS
+
+C<dpt install-dzil-deps>
+
+=head1 DESCRIPTION
+
+B<dpt install-dzil-deps> uses L<Dist::Zilla::Util::AuthorDeps> to scan
+the Perl module required to build a Perl module using L<Dist::Zilla> and install
+them as Debian package.
+
+Note: the installation is done with C<sudo apt-get install>, so you
+must have sudo configured properly.
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright (C) 2016 Dominique Dumont <dod at debian.org>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+=cut

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list