diff options
author | Aaron Crane <arc@cpan.org> | 2016-12-30 13:46:11 +0000 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2016-12-30 14:00:01 +0000 |
commit | 861c67962b02d8e31b9ab10311c73104f547e517 (patch) | |
tree | 14948043a024c1622b412c0ad503671e9cf0068a /Porting | |
parent | d11e29912382510f8a860432049f19d4ae72c228 (diff) | |
download | perl-861c67962b02d8e31b9ab10311c73104f547e517.tar.gz |
Porting/sync-with-cpan: more preflight checks for --tarball
If the file supplied doesn't exist (or names a directory), we'll get a
failure from Archive::Tar after having already made some changes.
Diffstat (limited to 'Porting')
-rwxr-xr-x | Porting/sync-with-cpan | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan index 13ba07a310..ac861da4c0 100755 --- a/Porting/sync-with-cpan +++ b/Porting/sync-with-cpan @@ -270,6 +270,8 @@ if ($cpan_mod =~ /-/ && $cpan_mod !~ /::/) { my $new_file; my $new_version; if (defined $tarball) { + die "Tarball $tarball does not exist\n" if !-e $tarball; + die "Tarball $tarball is not a plain file\n" if !-f _; $new_file = $tarball; $new_version = $version // ($new_file =~ /-([0-9._]+(?:-TRIAL[0-9]*)?)\.tar\.gz/) [0]; } |