Skip to content

Commit

Permalink
The argument to "test -n" must be quoted, otherwise we get a bogus
Browse files Browse the repository at this point in the history
"true" response to the test.
  • Loading branch information
lucasvr committed Mar 26, 2017
1 parent 647bf16 commit 605f44c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Functions/Compile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ function Verify_Files() {
local sums=($3)
local use_sha=($4)
if [ $use_sha == 1 ]
then
Get_Sum="Get_SHA"
else
Get_Sum="Get_MD5"
then Get_Sum="Get_SHA"
else Get_Sum="Get_MD5"
fi
for i in $(seq 0 $[${#myfiles[@]}-1])
do
Expand Down Expand Up @@ -312,11 +310,9 @@ function do_fetch() {
}
else
# Use sha checksum if available
if [ -n ${file_shas} ];
then
Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_shas[*]}" 1
else
Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_md5s[*]}" 0
if [ -n "${file_shas}" ];
then Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_shas[*]}" 1
else Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_md5s[*]}" 0
fi
result=$?
case $result in
Expand Down

0 comments on commit 605f44c

Please sign in to comment.