Skip to content

Commit

Permalink
use File::Which to find tar and unzip programs
Browse files Browse the repository at this point in the history
otherwise we need more config, which I would rather avoid for now
(see, my Mac on which I am testing does not put these programs in
the places expected, I guess; it uses /usr/bin/tar)
  • Loading branch information
rjbs committed Aug 13, 2011
1 parent b20754a commit 9051421
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/PAUSE/mldistwatch.pm
Expand Up @@ -21,6 +21,7 @@ use File::Basename ();
use File::Copy ();
use File::Spec ();
use File::Temp 0.14 (); # begin of OO interface
use File::Which ();
use HTTP::Date ();
use IPC::Cmd ();
use JSON ();
Expand Down Expand Up @@ -127,12 +128,10 @@ sub new {
}
}

my $tarbin = "/usr/local/bin/tar";
$tarbin = "/bin/tar" unless -x $tarbin;
my $tarbin = File::Which::which('tar');
die "No tarbin found" unless -x $tarbin;

my $unzipbin = "/usr/local/bin/unzip";
$unzipbin = "/usr/bin/unzip" unless -x $unzipbin;
my $unzipbin = File::Which::which('unzip');
die "No unzip found" unless -x $unzipbin;

my $self = bless {
Expand Down

0 comments on commit 9051421

Please sign in to comment.