@@ -358,16 +358,19 @@ function run_get_packages() {
358
358
# check if the file is already present
359
359
cd $PACKAGES_PATH
360
360
if [ -f $filename ]; then
361
-
362
- # check if the md5 is correct
363
- current_md5=$( md5sum $filename | cut -d\ -f1)
364
- if [ " X$current_md5 " == " X$md5 " ]; then
365
- # correct, no need to download
366
- do_download=0
361
+ if [ -n " $md5 " ]; then
362
+ # check if the md5 is correct
363
+ current_md5=$( md5sum $filename | cut -d\ -f1)
364
+ if [ " X$current_md5 " == " X$md5 " ]; then
365
+ # correct, no need to download
366
+ do_download=0
367
+ else
368
+ # invalid download, remove the file
369
+ error " Module $module have invalid md5, redownload."
370
+ rm $filename
371
+ fi
367
372
else
368
- # invalid download, remove the file
369
- error " Module $module have invalid md5, redownload."
370
- rm $filename
373
+ do_download=0
371
374
fi
372
375
fi
373
376
@@ -380,11 +383,13 @@ function run_get_packages() {
380
383
fi
381
384
382
385
# check md5
383
- current_md5=$( md5sum $filename | cut -d\ -f1)
384
- if [ " X$current_md5 " != " X$md5 " ]; then
385
- error " File $filename md5 check failed (got $current_md5 instead of $md5 )."
386
- error " Ensure the file is correctly downloaded, and update MD5S_$module "
387
- exit -1
386
+ if [ -n " $md5 " ]; then
387
+ current_md5=$( md5sum $filename | cut -d\ -f1)
388
+ if [ " X$current_md5 " != " X$md5 " ]; then
389
+ error " File $filename md5 check failed (got $current_md5 instead of $md5 )."
390
+ error " Ensure the file is correctly downloaded, and update MD5S_$module "
391
+ exit -1
392
+ fi
388
393
fi
389
394
390
395
# if already decompress, forget it
0 commit comments