mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-23 21:37:10 +02:00
fix download.pl for weird 'which' implementations
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5068 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
92eb69df51
commit
4665bf1d2c
@ -18,8 +18,17 @@ my $ok;
|
||||
|
||||
@ARGV > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n";
|
||||
|
||||
my $md5cmd = `which md5sum`;
|
||||
$md5cmd or $md5cmd = `which md5`;
|
||||
sub which($) {
|
||||
my $prog = shift;
|
||||
my $res = `which $prog`;
|
||||
$res or return undef;
|
||||
$res =~ /^no / and return undef;
|
||||
$res =~ /not found/ and return undef;
|
||||
return $res;
|
||||
}
|
||||
|
||||
my $md5cmd = which("md5sum");
|
||||
$md5cmd or $md5cmd = which("md5");
|
||||
$md5cmd or die 'no md5 checksum program found, please install md5 or md5sum';
|
||||
chomp $md5cmd;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user