[libmoosex-has-sugar-perl] 21/120: Customise script/beforescript
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 27 21:35:07 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 f57b28b152625b9eb2bfc5bed73c732e2648d5fa
Author: Kent Fredric <kentfredric at gmail.com>
Date: Mon Oct 21 01:53:50 2013 +1300
Customise script/beforescript
---
before_script.pl | 31 +++++++++++++++++++++++++++++++
script.pl | 32 ++++++++++++++++++++++++++++++++
yamls/sterile.yaml | 4 ++++
3 files changed, 67 insertions(+)
diff --git a/before_script.pl b/before_script.pl
new file mode 100644
index 0000000..4809820
--- /dev/null
+++ b/before_script.pl
@@ -0,0 +1,31 @@
+#!/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 ( -e './Build.PL' ) {
+ safe_exec( $^X, './Build.PL' );
+ safe_exec("./Build");
+ exit 0;
+}
+if ( -e './Makefile.PL' ) {
+ safe_exec( $^X, './Makefile.PL' );
+ safe_exec("make");
+ exit 0;
+}
+
diff --git a/script.pl b/script.pl
new file mode 100644
index 0000000..7e62d78
--- /dev/null
+++ b/script.pl
@@ -0,0 +1,32 @@
+#!/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 @paths = './t';
+
+if ( env_true('AUTHOR_TESTING') or env_true('RELEASE_TESTING') ) {
+ push @paths, './xt';
+}
+safe_exec( 'prove', '--blib', '--shuffle', '--color', '--recurse', '--jobs', 30, @paths );
diff --git a/yamls/sterile.yaml b/yamls/sterile.yaml
index 9383f42..596905c 100644
--- a/yamls/sterile.yaml
+++ b/yamls/sterile.yaml
@@ -14,6 +14,10 @@ before_install:
- time perl ./maint-travis-ci/sterilize_env.pl
install:
- time perl ./maint-travis-ci/install_deps.pl
+before_script:
+ - time perl ./maint-travis-ci/before_script.pl
+script:
+ - time perl ./maint-travis-ci/script.pl
branches:
only:
- "build/master"
--
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