--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings FATAL => 'all';
+use Getopt::Long qw(:config gnu_getopt);
+GetOptions(
+ "p|prefix=s@" => \(my $prefix = []),
+ "s|suffix=s@" => \(my $suffix = []),
+) or die "Error in command line arguments\n";
+
+my $version = shift or die "no version specified!\n";
+my $changelog = @ARGV ? shift : 'Changes';
+
+$version =~ s/\Av//;
+
+open my $fh, '<:raw', $changelog
+ or die "can't open $changelog: $!\n";
+my $version_log = '';
+my $found_version;
+while (my $line = <$fh>) {
+ if ($found_version) {
+ last
+ if $line =~ /^\S/;
+ $version_log .= $line;
+ }
+ elsif ($line =~ /^v?\Q$version\E/) {
+ $found_version = 1;
+ }
+}
+close $fh;
+die "couldn't find heading for $version in $changelog!\n"
+ unless $found_version;
+
+$version_log =~ s/\r\n?/\n/g;
+$version_log =~ s/\n+\z//;
+
+s/\n\z//
+ for @$prefix, @$suffix;
+
+print join("\n\n", @$prefix, $version_log, @$suffix) . "\n";
DISTTEST_MAKEFILE_PARAMS => '',
AUTHORS => $self->quote_literal(join(', ', @$authors)),
LICENSES => join(' ', map $self->quote_literal($_), @$licenses),
+ GET_CHANGELOG => '$(ABSPERLRUN) $(HELPERS)/get-changelog $(VERSION) $(CHANGELOG)',
);
my $dist_test = $self->SUPER::dist_test(@_);
$(MAKE) disttest RELEASE_TESTING=1 DISTTEST_MAKEFILE_PARAMS="PREREQ_FATAL=1" PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
release: preflight
$(MAKE) releasetest
- git commit -a -m "Release commit for $(VERSION)"
- git tag v$(VERSION) -m "release v$(VERSION)"
+ $(GET_CHANGELOG) -p"Release commit for $(VERSION)" | git commit -a -F -
+ $(GET_CHANGELOG) -p"release v$(VERSION)" | git tag -a -F - "v$(VERSION)"
$(RM_RF) $(DISTVNAME)
$(MAKE) $(DISTVNAME).tar$(SUFFIX)
$(NOECHO) $(MAKE) pushrelease FAKE_RELEASE=$(FAKE_RELEASE)