"%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 > 0 or die "Please add:\n\n$ARGV[0] - $ymd\n\nto Changes stage Changes (git add Changes)";
@cached == 2 or die "Pre-commit Changes not just Changes line";
- $cached[0] eq "+++ b/Changes\n" or die "Changes not changed";
+ $cached[0] =~ /^\+\+\+ .\/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 ";
}
-sub MY::postamble { <<'END'; }
+sub MY::postamble {
+ my ($self, %extra) = @_;
+
+ my $post = <<'END';
preflight:
perl -IDistar/lib -MDistar -erun_preflight $(VERSION)
release: preflight
$(MAKE) disttest
rm -rf $(DISTVNAME)
$(MAKE) $(DISTVNAME).tar$(SUFFIX)
- cpan-upload $(DISTVNAME).tar$(SUFFIX)
git commit -a -m "Release commit for $(VERSION)"
git tag v$(VERSION) -m "release v$(VERSION)"
- git push --tags
- git push
+ cpan-upload $(DISTVNAME).tar$(SUFFIX)
+ git push origin --tags HEAD
distdir: readmefile
readmefile: create_distdir
pod2text $(VERSION_FROM) >$(DISTVNAME)/README
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) ../Distar/helpers/add-readme-to-manifest
END
+ if (open my $fh, '<', 'maint/Makefile.include') {
+ $post .= do { local $/; <$fh> };
+ }
+ $post .= "\n" . join('', %extra) if keys %extra;
+ return $post;
+}
{
no warnings 'redefine';