Skip to content

Commit dafc5ed

Browse files
committed
add -c to make changes entry on the command line
1 parent aaef82e commit dafc5ed

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

lib/Module/Release.pm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,16 +1316,17 @@ sub _run_error_set { $_[0]->{_run_error} = 1 }
13161316
sub run_error { $_[0]->{_run_error} }
13171317

13181318
sub run {
1319-
my( $self, $command ) = @_;
1319+
my( $self, @command ) = @_;
1320+
@command = grep { defined } @command;
13201321

13211322
$self->_run_error_reset;
13221323

1323-
$self->_debug( "$command\n" );
1324-
$self->_die( "Didn't get a command!" ) unless defined $command;
1324+
$self->_debug( "@command\n" );
1325+
$self->_die( "Didn't get a command!" ) unless @command;
13251326

13261327
my $pid = IPC::Open3::open3(
13271328
my $child_in, my $child_out, my $child_err = gensym,
1328-
$command
1329+
@command
13291330
);
13301331
close $child_in;
13311332

@@ -1352,19 +1353,18 @@ sub run {
13521353
}
13531354

13541355
if( $error =~ m/exec of .*? failed| Windows/x ) {
1355-
$self->_warn( "Could not run <$command>: $error" );
1356+
$self->_warn( "Could not run <$command[0]>: $error" );
13561357
}
13571358
$self->_debug( $self->_dashes, "\n" );
13581359

13591360
waitpid( $pid, 0 );
13601361
my $child_exit_status = $? >> 8;
13611362

1362-
13631363
$self->_warn( $error ) if length $error;
13641364

13651365
if( $child_exit_status ) {
13661366
$self->_run_error_set;
1367-
$self->_warn( "Command [$command] didn't close cleanly: $child_exit_status" );
1367+
$self->_warn( "Command [$command[0]] didn't close cleanly: $child_exit_status" );
13681368
}
13691369

13701370
return $output;

script/release

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ the C<perls> configuration setting.
9292
If there are modified files, added files, or extra files so that
9393
source control complains, fail.
9494
95+
=item Check that any GPG signatures are correct
96+
97+
If C<gpg_signatures> is present in the config, load
98+
L<Module::Release::VerifyGPGSignature> and verify the configured
99+
signatures.
100+
95101
=item Upload to PAUSE
96102
97103
This program used to use FTP uploads, but PAUSE has turned off that feature.
@@ -122,7 +128,7 @@ in the configuration file
122128
Specify the F<Changes> file entry on the command line. If STRING does
123129
not start with a C<*>, one will be added to the start along with a space.
124130
125-
release -C "some change"
131+
release -c "* some change"
126132
127133
translates to the F<Changes> entry with the date and one bullet item:
128134
@@ -460,13 +466,14 @@ sub usage {
460466
my $err = shift and select STDERR;
461467
print <<"USE";
462468
463-
Use: release -aCdDhkmptTvV [-j[N]] [ LOCAL_FILE [ REMOTE_FILE ] ]
469+
Use: release -acCdDhkmptTvV [-j[N]] [ LOCAL_FILE [ REMOTE_FILE ] ]
464470
465471
Will upload current release LOCAL_FILE, naming it REMOTE_FILE. Will
466472
get LOCAL_FILE and REMOTE_FILE automatically (using same name for
467473
both) if not supplied.
468474
469475
-a Set AUTOMATED_TESTING to true
476+
-c Changes entry as a string on the command line
470477
-C Skip Changes file (useful for re-running botched releases)
471478
-d Print extra debugging information
472479
-D Skip building the dist
@@ -663,7 +670,7 @@ $release->_debug( "dist version is <$Version>\n" );
663670

664671
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
665672
# check anything signed by GPG
666-
unless( $release->config->gpg_signatures ) {
673+
if( $release->config->gpg_signatures ) {
667674
$release->_print("============ Checking GPG signatures\n");
668675
$release->load_mixin('Module::Release::VerifyGPGSignature');
669676
$release->check_all_gpg_signatures;
@@ -799,9 +806,9 @@ unless( $opts{C} or $release->config->skip_changes ) {
799806
}
800807
};
801808

802-
my $vcs_commit = `$command "$commit_message" 2>&1`;
809+
my $output = $release->run( qq($command "$commit_message") );
803810

804-
$release->_print( $vcs_commit );
811+
$release->_print( $output );
805812
}
806813
else {
807814
$release->_print( "Skipping Changes file\n" );

0 commit comments

Comments
 (0)