Skip Menu |

This queue is for tickets about the ShipIt CPAN distribution.

Report information
The Basics
Id: 29652
Status: open
Priority: 0/
Queue: ShipIt

People
Owner: Nobody in particular
Requestors: marcel [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.51
Fixed in: (no value)



Subject: ShipIt::Step::UploadCPAN doesn't work if 'which' doesn't silently fail
on Mac OS X (Tiger), which(1) doesn't fail silently: $ which foobar no foobar in /usr/local/bin /usr/bin ... so ShipIt::Step::UploadCPAN gets that error message in $self->{exe} and thus the upload fails. Attached is a version of UploadCPAN.pm which uses the more portable File::Which.
Subject: UploadCPAN.pm
package ShipIt::Step::UploadCPAN; use warnings; use strict; use File::Which; use ShipIt::Util qw(bool_prompt); use base 'ShipIt::Step'; sub init { my ($self, $conf) = @_; my $exe; $exe = which('cpan-upload-http') || which('cpan-upload'); die "neither cpan-upload-http nor cpan-upload found\n" unless $exe; $self->{exe} = $exe; } sub run { my ($self, $state) = @_; my $distfile = $state->distfile; die "No distfile was created!" unless $distfile; die "distfile $distfile no longer exists!" unless -e $distfile; if ($state->dry_run) { warn "*** DRY RUN, not uploading to CPAN!\n"; return; } return unless bool_prompt("Upload to CPAN?", "y"); system($self->{exe}, $distfile) and die "Upload failed.\n"; } 1;
I don't want to add a dependency just for OS X. If the dependency is optional (will use File::Which only if which fails), then I'm cool with this.