From: Graham Knop Date: Sat, 5 Dec 2015 07:49:24 +0000 (-0500) Subject: split version checking out from preflight X-Git-Tag: v0.003000~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b418de8a06fed447e6642cc3b905d187ba66a3c;p=p5sagit%2FDistar.git split version checking out from preflight --- diff --git a/helpers/check-version b/helpers/check-version new file mode 100755 index 0000000..05635aa --- /dev/null +++ b/helpers/check-version @@ -0,0 +1,16 @@ +#!/usr/bin/env perl +use strict; +use warnings FATAL => 'all'; +use ExtUtils::MakeMaker (); + +my $version = shift + or die "version required!"; + +my $bad = join '', + map { + my $file_version = MM->parse_version($_); + ($file_version eq 'undef' || $file_version eq $version) ? '' + : "Module $_ version $file_version doesn't match dist version $version!\n"; + } @ARGV; + +die $bad if $bad; diff --git a/helpers/preflight b/helpers/preflight index 6d104be..56e2830 100755 --- a/helpers/preflight +++ b/helpers/preflight @@ -4,7 +4,6 @@ use warnings FATAL => 'all'; use Config; use File::Spec; use File::Find; -use ExtUtils::MakeMaker (); use Getopt::Long qw(:config gnu_getopt); GetOptions( @@ -22,14 +21,6 @@ if (system("git rev-parse --quiet --verify v$version >$null") == 0) { die "Tag v$version already exists!"; } -File::Find::find({ no_chdir => 1, wanted => sub { - return - unless -f && /\.pm$/; - my $file_version = MM->parse_version($_); - die "Module $_ version $file_version doesn't match dist version $version" - unless $file_version eq 'undef' || $file_version eq $version; -}}, 'lib'); - for (scalar `"$make" manifest 2>&1 >$null`) { $_ && die "$make manifest changed:\n$_ Go check it and retry"; } diff --git a/lib/Distar.pm b/lib/Distar.pm index dc0a9b8..927d105 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -101,6 +101,7 @@ sub write_manifest_skip { my $targets = $self->SUPER::special_targets(@_); my $phony_targets = join ' ', qw( preflight + check-version releasetest release readmefile @@ -139,8 +140,10 @@ sub write_manifest_skip { (map "$_ = $vars{$_}\n", sort keys %vars), <<'END', -preflight: +preflight: check-version $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) --changelog=$(CHANGELOG) --branch=$(BRANCH) +check-version: + $(ABSPERLRUN) Distar/helpers/check-version $(VERSION) $(TO_INST_PM) $(EXE_FILES) releasetest: $(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\"" release: preflight releasetest