From: Graham Knop Date: Thu, 12 Nov 2015 10:03:03 +0000 (-0500) Subject: configurable Changes filename X-Git-Tag: v0.003000~41 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b920c5cd3611f36624ec9eb87f5ef822e0fe465;p=p5sagit%2FDistar.git configurable Changes filename --- diff --git a/helpers/preflight b/helpers/preflight index a923c9d..6d104be 100755 --- a/helpers/preflight +++ b/helpers/preflight @@ -9,6 +9,7 @@ use Getopt::Long qw(:config gnu_getopt); GetOptions( "branch=s" => \(my $branch = 'master'), + "changelog=s" => \(my $changelog = 'Changes'), ) or die("Error in command line arguments\n"); my $version = shift or die "version required!"; @@ -46,10 +47,10 @@ my $ymd = sprintf( ); my $changes_line = "$version - $ymd\n"; my @cached = grep /^\+/, `git diff --cached -U0`; -@cached > 0 or die "Please add:\n\n$changes_line\nto Changes stage Changes (git add Changes)"; -@cached == 2 or die "Pre-commit Changes not just Changes line"; -$cached[0] =~ /^\+\+\+ .\/Changes\n/ or die "Changes not changed"; -$cached[1] eq "+$changes_line" or die "Changes new line should be: \n\n$changes_line "; +@cached > 0 or die "Please add:\n\n$changes_line\nto $changelog and stage $changelog (git add $changelog)"; +@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"; diff --git a/lib/Distar.pm b/lib/Distar.pm index 5948741..8e1c51d 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -130,6 +130,7 @@ sub write_manifest_skip { my %vars = ( REMAKE => join(' ', '$(PERLRUN)', 'Makefile.PL', map { $self->quote_literal($_) } @ARGV), BRANCH => $self->{BRANCH} ||= 'master', + CHANGELOG => $self->{CHANGELOG} ||= 'Changes', ); join('', @@ -139,7 +140,7 @@ sub write_manifest_skip { <<'END', preflight: - $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) --branch=$(BRANCH) + $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) --changelog=$(CHANGELOG) --branch=$(BRANCH) releasetest: $(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\"" release: preflight releasetest @@ -159,7 +160,7 @@ disttest: distmanicheck distmanicheck: create_distdir cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck" nextrelease: - $(ABSPERLRUN) Distar/helpers/add-changelog-heading --git $(VERSION) Changes + $(ABSPERLRUN) Distar/helpers/add-changelog-heading --git $(VERSION) $(CHANGELOG) refresh: cd Distar && git pull $(RM_F) $(FIRST_MAKEFILE)