From: Matt S Trout Date: Fri, 15 Jul 2011 15:44:37 +0000 (+0000) Subject: cleanup Changes and README handling X-Git-Tag: v0.001000~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59fcfa653aedcc97b143a0a6bcf73f90733bf862;p=p5sagit%2FDistar.git cleanup Changes and README handling --- diff --git a/lib/Distar.pm b/lib/Distar.pm index 76268d3..d5b40b8 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -59,12 +59,13 @@ sub run_preflight { for (scalar `git diff`) { length && die "Oustanding changes"; } - my @cached = grep /^\+/, `git diff --cached -U0`; - @cached == 2 or die "Pre-commit Changes not just Changes line"; - $cached[0] eq "+++ b/Changes\n" or die "Changes not changed"; my $ymd = sprintf( "%i-%02i-%02i", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3] ); + my @cached = grep /^\+/, `git diff --cached -U0`; + @cached > 0 or die "Please add:\n\n$ARGV[0] - $ymd\n\nto Changes and git add"; + @cached == 2 or die "Pre-commit Changes not just Changes line"; + $cached[0] eq "+++ b/Changes\n" or die "Changes not changed"; $cached[1] eq "+$ARGV[0] - $ymd\n" or die "Changes new line should be: \n\n$ARGV[0] - $ymd\n "; } @@ -81,6 +82,8 @@ release: upload distdir: readmefile readmefile: create_distdir pod2text $(VERSION_FROM) >$(DISTVNAME)/README + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{README} => q{README file (added by Distar)}}) } ' \ + -e ' or print "Could not add README to MANIFEST: $${'\''@'\''}\n"' -- END {