[libmoosex-has-sugar-perl] 18/120: Add install_deps tool

Intrigeri intrigeri at moszumanska.debian.org
Wed Aug 27 21:35:06 UTC 2014


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

intrigeri pushed a commit to annotated tag 0.05070422-source
in repository libmoosex-has-sugar-perl.

commit ff1895d5b89262ba5d968f67e2092b703c21dc6e
Author: Kent Fredric <kentfredric at gmail.com>
Date:   Mon Oct 21 00:25:12 2013 +1300

    Add install_deps tool
---
 install_deps.pl | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/install_deps.pl b/install_deps.pl
new file mode 100644
index 0000000..4cffe5a
--- /dev/null
+++ b/install_deps.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+
+sub diag { print STDERR @_; print STDERR "\n" }
+sub env_exists { return exists $ENV{ $_[0] } }
+sub env_true { return env_exists( $_[0] ) and $ENV{ $_[0] } }
+
+sub safe_exec {
+  my ( $command, @params ) = @_;
+  diag("running $command @params");
+  my $exit = system( $command, @params );
+  if ( $exit != 0 ) {
+    warn "$command failed: $? $!";
+    exit $exit;
+  }
+  return 1;
+}
+
+if ( not env_exists('TRAVIS') ) {
+  diag('Is not running under travis!');
+  exit 1;
+}
+
+my (@params) = qw[ --quiet --notest --mirror http://cpan.metacpan.org/ --no-man-pages ];
+if ( env_true('DEVELOPER_DEPS') ) {
+  push @params, '--dev';
+}
+safe_exec( 'cpanm', @params, '--installdeps', '.' );
+if ( env_true('AUTHOR_TESTING') or env_true('RELEASE_TESTING') ) {
+  safe_exec( 'cpanm', @params, '--with-develop', '--installdeps', '.' );
+}
+
+exit 0;

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



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