};
my $reqs = {
- dist_upload => {
- req => {
- 'CPAN::Uploader' => '0.103001',
- },
- },
-
- dist_podinherit => {
- req => {
- 'Pod::Inherit' => '0.90',
- 'Pod::Tree' => '0',
- }
- },
-
replicated => {
req => $replicated,
pod => {
},
},
+ dist_dir => {
+ req => {
+ 'Pod::Inherit' => '0.90',
+ 'Pod::Tree' => '0',
+ }
+ },
+
+ dist_upload => {
+ req => {
+ 'CPAN::Uploader' => '0.103001',
+ },
+ },
+
};
+our %req_availability_cache;
sub req_list_for {
my ($class, $group) = @_;
}
-our %req_availability_cache;
+sub die_unless_req_ok_for {
+ my ($class, $group) = @_;
+
+ Carp::croak "die_unless_req_ok_for() expects a requirement group name"
+ unless $group;
+
+ $class->_check_deps($group)->{status}
+ or die sprintf( "Required modules missing, unable to continue: %s\n", $class->_check_deps($group)->{missing} );
+}
+
sub req_ok_for {
my ($class, $group) = @_;
returning the actual error seen by the user.
EOD
+ '=head2 die_unless_req_ok_for',
+ '=over',
+ '=item Arguments: $group_name',
+ '=back',
+ <<'EOD',
+Checks if L</req_ok_for> passes for the supplied C<$group_name>, and
+in case of failure throws an exception including the information
+from L</req_missing_for>.
+EOD
+
'=head2 req_errorlist_for',
'=over',
'=item Arguments: $group_name',
return <<"EOM";
$snippet
-create_distdir : clonedir_generate_files clonedir_post_generate_files fresh_manifest create_distdir_copy_manifested clonedir_cleanup_generated_files
+create_distdir : check_create_distdir_prereqs clonedir_generate_files clonedir_post_generate_files fresh_manifest create_distdir_copy_manifested clonedir_cleanup_generated_files
\t\$(NOECHO) \$(NOOP)
clonedir_generate_files :
clonedir_cleanup_generated_files :
\t\$(NOECHO) \$(NOOP)
+check_create_distdir_prereqs :
+\t\$(NOECHO) @{[
+ $mm_proto->oneliner("DBIx::Class::Optional::Dependencies->die_unless_req_ok_for(q(dist_dir))", [qw/-Ilib -MDBIx::Class::Optional::Dependencies/])
+]}
+
EOM
}
}
+# add an upload target check as a *preamble*
+# will ensure things being assembled in the right order
+preamble <<"EOP";
+
+upload :: check_create_distdir_prereqs check_upload_dist_prereqs
+
+check_upload_dist_prereqs :
+\t\$(NOECHO) @{[
+ $mm_proto->oneliner("DBIx::Class::Optional::Dependencies->die_unless_req_ok_for(q(dist_upload))", [qw/-Ilib -MDBIx::Class::Optional::Dependencies/])
+]}
+
+EOP
+
# EU::MM BUG - workaround
# somehow the init_PM of EUMM (in MM_Unix) interprets ResultClass.pod.proto
# as a valid ResultClass.pod. While this has no effect on dist-building
source maint/travis-ci_scripts/common.bash
if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi
-[[ "$CLEANTEST" = "true" ]] || run_or_err "Attempt to build a dist with all prereqs present" "make dist"
+if [[ "$CLEANTEST" != "true" ]] ; then
+ parallel_installdeps_notest $(perl -Ilib -MDBIx::Class -e 'print join " ", keys %{DBIx::Class::Optional::Dependencies->req_list_for("dist_dir")}')
+ run_or_err "Attempt to build a dist with all prereqs present" "make dist"
+fi