summaryrefslogtreecommitdiff
path: root/Porting
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2016-12-30 13:46:11 +0000
committerAaron Crane <arc@cpan.org>2016-12-30 14:00:01 +0000
commit861c67962b02d8e31b9ab10311c73104f547e517 (patch)
tree14948043a024c1622b412c0ad503671e9cf0068a /Porting
parentd11e29912382510f8a860432049f19d4ae72c228 (diff)
downloadperl-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-xPorting/sync-with-cpan2
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];
}