split out checking for cpan-upload from preflight
Graham Knop [Sat, 5 Dec 2015 08:29:18 +0000 (03:29 -0500)]
helpers/preflight
lib/Distar.pm

index 1d38b13..2e7d75f 100755 (executable)
@@ -38,6 +38,3 @@ my @cached = grep /^\+/, `git diff --cached -U0`;
 @cached == 2 or die "All '$changelog' changes must be committed aside from version heading";
 $cached[0] =~ /^\+\+\+ .\/\Q$changelog\E\n/ or die "$changelog not changed";
 $cached[1] eq "+$changes_line" or die "$changelog new line should be: \n\n$changes_line ";
-
-{ no warnings 'exec'; `cpan-upload -h`; }
-$? and die "cpan-upload not available";
index b702c80..2248b39 100644 (file)
@@ -103,6 +103,7 @@ sub write_manifest_skip {
       preflight
       check-version
       check-manifest
+      check-cpan-upload
       releasetest
       release
       readmefile
@@ -133,6 +134,7 @@ sub write_manifest_skip {
       REMAKE => join(' ', '$(PERLRUN)', 'Makefile.PL', map { $self->quote_literal($_) } @ARGV),
       BRANCH => $self->{BRANCH} ||= 'master',
       CHANGELOG => $self->{CHANGELOG} ||= 'Changes',
+      DEV_NULL_STDOUT => ($self->{DEV_NULL} ? '>'.File::Spec->devnull : ''),
     );
 
     join('',
@@ -141,12 +143,14 @@ sub write_manifest_skip {
       (map "$_ = $vars{$_}\n", sort keys %vars),
       <<'END',
 
-preflight: check-version check-manifest
+preflight: check-version check-manifest check-cpan-upload
        $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) --changelog=$(CHANGELOG) --branch=$(BRANCH)
 check-version:
        $(ABSPERLRUN) Distar/helpers/check-version $(VERSION) $(TO_INST_PM) $(EXE_FILES)
 check-manifest:
        $(ABSPERLRUN) Distar/helpers/check-manifest
+check-cpan-upload:
+       $(NOECHO) cpan-upload -h $(DEV_NULL_STDOUT)
 releasetest:
        $(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
 release: preflight releasetest