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
3c1e4b42
Commit
3c1e4b42
authored
Nov 15, 2012
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved the download message to hide mirror URLs if they're 404s
parent
302a822d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
10 deletions
+37
-10
bin/ruby-build
+37
-10
No files found.
bin/ruby-build
View file @
3c1e4b42
...
@@ -112,7 +112,9 @@ install_package_using() {
...
@@ -112,7 +112,9 @@ install_package_using() {
make_package
"
$package_name
"
$*
make_package
"
$package_name
"
$*
popd
>
&4
popd
>
&4
echo
"Installed
${
package_name
}
to
${
PREFIX_PATH
}
"
>
&2
{
echo
"Installed
${
package_name
}
to
${
PREFIX_PATH
}
"
echo
}
>
&2
}
}
make_package
()
{
make_package
()
{
...
@@ -165,17 +167,37 @@ verify_checksum() {
...
@@ -165,17 +167,37 @@ verify_checksum() {
fi
fi
}
}
retrieve_url
()
{
http
()
{
if
type
curl &>/dev/null
;
then
local
method
=
"
$1
"
curl
-Lf
"
$@
"
local
url
=
"
$2
"
[
-n
"
$url
"
]
||
return
1
if
type
curlx &>/dev/null
;
then
"http_
${
method
}
_curl"
"
$url
"
elif
type
wget &>/dev/null
;
then
elif
type
wget &>/dev/null
;
then
wget
-O-
"
$@
"
"http_
${
method
}
_wget"
"
$url
"
else
else
echo
"error: please install
\`
curl
\`
or
\`
wget
\`
and try again"
>
&2
echo
"error: please install
\`
curl
\`
or
\`
wget
\`
and try again"
>
&2
exit
1
exit
1
fi
fi
}
}
http_head_curl
()
{
curl
-sILf
"
$1
"
>
&4 2>&1
}
http_get_curl
()
{
curl
-sSLf
"
$1
"
}
http_head_wget
()
{
wget
-q
--spider
"
$1
"
>
&4 2>&1
}
http_get_wget
()
{
wget
-nv
-O-
"
$1
"
}
fetch_tarball
()
{
fetch_tarball
()
{
local
package_name
=
"
$1
"
local
package_name
=
"
$1
"
local
package_url
=
"
$2
"
local
package_url
=
"
$2
"
...
@@ -191,9 +213,13 @@ fetch_tarball() {
...
@@ -191,9 +213,13 @@ fetch_tarball() {
fi
fi
local
package_filename
=
"
${
package_name
}
.tar.gz"
local
package_filename
=
"
${
package_name
}
.tar.gz"
symlink_tarball_from_cache
"
$package_filename
"
"
$checksum
"
||
symlink_tarball_from_cache
"
$package_filename
"
"
$checksum
"
||
{
download_tarball
"
$mirror_url
"
"
$package_filename
"
"
$checksum
"
||
echo
"Downloading
${
package_filename
}
..."
>
&2
download_tarball
"
$package_url
"
"
$package_filename
"
"
$checksum
"
{
http head
"
$mirror_url
"
&&
download_tarball
"
$mirror_url
"
"
$package_filename
"
"
$checksum
"
}
||
download_tarball
"
$package_url
"
"
$package_filename
"
"
$checksum
"
}
{
tar
xzvf
"
$package_filename
"
{
tar
xzvf
"
$package_filename
"
rm
-f
"
$package_filename
"
rm
-f
"
$package_filename
"
...
@@ -219,8 +245,9 @@ download_tarball() {
...
@@ -219,8 +245,9 @@ download_tarball() {
local
package_filename
=
"
$2
"
local
package_filename
=
"
$2
"
local
checksum
=
"
$3
"
local
checksum
=
"
$3
"
echo
"Downloading
${
package_url
}
..."
>
&2
echo
"->
$package_url
"
>
&2
{
retrieve_url
"
$package_url
"
>
"
$package_filename
"
{
http get
"
$package_url
"
>
"
$package_filename
"
verify_checksum
"
$package_filename
"
"
$checksum
"
verify_checksum
"
$package_filename
"
"
$checksum
"
}
>
&4 2>&1
||
return
1
}
>
&4 2>&1
||
return
1
...
...
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