From: Graham Knop Date: Sat, 5 Dec 2015 08:27:22 +0000 (-0500) Subject: split manifest checking out from preflight and improve X-Git-Tag: v0.003000~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5baee32c5c12eeebdfebcdeb137b04c0630754be;p=p5sagit%2FDistar.git split manifest checking out from preflight and improve --- diff --git a/helpers/check-manifest b/helpers/check-manifest new file mode 100755 index 0000000..794e8aa --- /dev/null +++ b/helpers/check-manifest @@ -0,0 +1,30 @@ +#!/usr/bin/env perl +use strict; +use warnings FATAL => 'all'; +use ExtUtils::Manifest qw(filecheck maniread maniskip manicheck mkmanifest); + +{ + local $ExtUtils::Manifest::Quiet = 1; + my $manimiss = ! -e 'MANIFEST'; + if (-e 'MANIFEST') { + my @extra = manicheck; + if (@extra) { + die "Files in MANIFEST are missing from file system:\n" + . join('', map " $_\n", @extra); + } + + my $read = maniread; + my $skip = maniskip; + + my @missing = manicheck; + my @remove = grep $skip->($_), sort keys %$read; + + exit 0 + if !(@missing || @remove); + } +} + +warn "Updating MANIFEST:\n"; +mkmanifest; +warn "Go check it and retry.\n"; +exit 1; diff --git a/helpers/preflight b/helpers/preflight index 56e2830..1d38b13 100755 --- a/helpers/preflight +++ b/helpers/preflight @@ -21,10 +21,6 @@ if (system("git rev-parse --quiet --verify v$version >$null") == 0) { die "Tag v$version already exists!"; } -for (scalar `"$make" manifest 2>&1 >$null`) { - $_ && die "$make manifest changed:\n$_ Go check it and retry"; -} - for (scalar `git status`) { /^(?:# )?On branch \Q$branch\E/ || die "Not on $branch. EEEK"; /Your branch is behind|Your branch and .*? have diverged/ && die "Not synced with upstream"; diff --git a/lib/Distar.pm b/lib/Distar.pm index 927d105..b702c80 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -102,6 +102,7 @@ sub write_manifest_skip { my $phony_targets = join ' ', qw( preflight check-version + check-manifest releasetest release readmefile @@ -140,10 +141,12 @@ sub write_manifest_skip { (map "$_ = $vars{$_}\n", sort keys %vars), <<'END', -preflight: check-version +preflight: check-version check-manifest $(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 releasetest: $(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\"" release: preflight releasetest