Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
018357fe
Commit
018357fe
authored
Jan 15, 2016
by
Jason Karns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert checksum algorithm chooser to switch case
parent
6bdc16c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
bin/ruby-build
+4
-3
No files found.
bin/ruby-build
View file @
018357fe
...
@@ -259,11 +259,12 @@ verify_checksum() {
...
@@ -259,11 +259,12 @@ verify_checksum() {
local
expected_checksum
=
`
echo
"
$2
"
| tr
[
A-Z]
[
a-z]
`
local
expected_checksum
=
`
echo
"
$2
"
| tr
[
A-Z]
[
a-z]
`
[
-n
"
$expected_checksum
"
]
||
return
0
[
-n
"
$expected_checksum
"
]
||
return
0
# If the checksum length is 32 chars, assume MD5, otherwise SHA2
case
"
${#
expected_checksum
}
"
in
if
[
"
${#
expected_checksum
}
"
-eq
32
]
;
then
32
)
# MD5
[
-n
"
$HAS_MD5_SUPPORT
"
]
||
return
0
[
-n
"
$HAS_MD5_SUPPORT
"
]
||
return
0
checksum_command
=
"compute_md5"
checksum_command
=
"compute_md5"
fi
;;
esac
# If the computed checksum is empty, return failure
# If the computed checksum is empty, return failure
local
computed_checksum
=
`
echo
"
$(
$checksum_command
<
"
$filename
"
)
"
| tr
[
A-Z]
[
a-z]
`
local
computed_checksum
=
`
echo
"
$(
$checksum_command
<
"
$filename
"
)
"
| tr
[
A-Z]
[
a-z]
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment