projects
/
openwrt
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d5aeb44
)
fix download.pl for weird 'which' implementations
author
Felix Fietkau
<nbd@openwrt.org>
Sat, 14 Oct 2006 00:07:19 +0000
(
00:07
+0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Sat, 14 Oct 2006 00:07:19 +0000
(
00:07
+0000)
SVN-Revision: 5068
scripts/download.pl
patch
|
blob
|
history
diff --git
a/scripts/download.pl
b/scripts/download.pl
index f636cca7eb3fa1d9d4c7128cc6b7f513d46a22b3..c29b5fe78e331dbcae809a281746467db0c47a3a 100755
(executable)
--- a/
scripts/download.pl
+++ b/
scripts/download.pl
@@
-18,8
+18,17
@@
my $ok;
@ARGV > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n";
@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;
$md5cmd or die 'no md5 checksum program found, please install md5 or md5sum';
chomp $md5cmd;