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
2b26f23d
Commit
2b26f23d
authored
Aug 07, 2011
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trap failures and print an error message. Use file descriptors to avoid swallowing errors.
parent
1a8c1437
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
bin/ruby-build
+24
-12
No files found.
bin/ruby-build
View file @
2b26f23d
#!/bin/bash
#!/bin/bash
set
-e
set
-E
exec
3<&2
# preserve original stderr at fd 3
abs_dirname
()
{
abs_dirname
()
{
local
cwd
=
"
$(
pwd
)
"
local
cwd
=
"
$(
pwd
)
"
...
@@ -16,12 +17,15 @@ abs_dirname() {
...
@@ -16,12 +17,15 @@ abs_dirname() {
cd
"
$cwd
"
cd
"
$cwd
"
}
}
log
()
{
build_failed
()
{
if
[
-z
"
$VERBOSE
"
]
;
then
{
echo
cat
>>
"
$LOG_PATH
"
echo
"BUILD FAILED"
else
echo
tee
-a
"
$LOG_PATH
"
echo
"Inspect or clean up the working tree at
${
TEMP_PATH
}
"
fi
echo
"Results logged to
${
LOG_PATH
}
"
echo
}
>
&3
exit
1
}
}
install_package
()
{
install_package
()
{
...
@@ -47,14 +51,14 @@ download_package() {
...
@@ -47,14 +51,14 @@ download_package() {
echo
"Downloading
${
package_url
}
..."
>
&2
echo
"Downloading
${
package_url
}
..."
>
&2
{
curl
"
$package_url
"
>
"
${
package_name
}
.tar.gz"
{
curl
"
$package_url
"
>
"
${
package_name
}
.tar.gz"
}
2>&1 | log
}
>
&4 2>&1
}
}
extract_package
()
{
extract_package
()
{
local
package_name
=
"
$1
"
local
package_name
=
"
$1
"
{
tar
xzvf
"
${
package_name
}
.tar.gz"
{
tar
xzvf
"
${
package_name
}
.tar.gz"
}
2>&1 | log
}
>
&4 2>&1
}
}
build_package
()
{
build_package
()
{
...
@@ -80,14 +84,14 @@ build_package_standard() {
...
@@ -80,14 +84,14 @@ build_package_standard() {
{
./configure
--prefix
=
"
$PREFIX_PATH
"
{
./configure
--prefix
=
"
$PREFIX_PATH
"
make
-j
2
make
-j
2
make install
make install
}
2>&1 | log
}
>
&4 2>&1
}
}
build_package_ruby
()
{
build_package_ruby
()
{
local
package_name
=
"
$1
"
local
package_name
=
"
$1
"
{
"
$RUBY_BIN
"
setup.rb
{
"
$RUBY_BIN
"
setup.rb
}
2>&1 | log
}
>
&4 2>&1
}
}
build_package_rbx
()
{
build_package_rbx
()
{
...
@@ -95,7 +99,7 @@ build_package_rbx() {
...
@@ -95,7 +99,7 @@ build_package_rbx() {
{
./configure
--prefix
=
"
$PREFIX_PATH
"
{
./configure
--prefix
=
"
$PREFIX_PATH
"
rake install
rake install
}
2>&1 | log
}
>
&4 2>&1
}
}
build_package_copy
()
{
build_package_copy
()
{
...
@@ -181,12 +185,20 @@ TEMP_PATH="/tmp/ruby-build.${SEED}"
...
@@ -181,12 +185,20 @@ TEMP_PATH="/tmp/ruby-build.${SEED}"
RUBY_BIN
=
"
${
PREFIX_PATH
}
/bin/ruby"
RUBY_BIN
=
"
${
PREFIX_PATH
}
/bin/ruby"
CWD
=
"
$(
pwd
)
"
CWD
=
"
$(
pwd
)
"
exec
4<
>
"
$LOG_PATH
"
# open the log file at fd 4
if
[
-n
"
$VERBOSE
"
]
;
then
tail
-f
"
$LOG_PATH
"
&
trap
"kill 0"
SIGINT SIGTERM EXIT
fi
export
LDFLAGS
=
"-L'
${
PREFIX_PATH
}
/lib'
${
LDFLAGS
}
"
export
LDFLAGS
=
"-L'
${
PREFIX_PATH
}
/lib'
${
LDFLAGS
}
"
export
CPPFLAGS
=
"-I'
${
PREFIX_PATH
}
/include'
${
CPPFLAGS
}
"
export
CPPFLAGS
=
"-I'
${
PREFIX_PATH
}
/include'
${
CPPFLAGS
}
"
unset
RUBYOPT
unset
RUBYOPT
unset
RUBYLIB
unset
RUBYLIB
trap
build_failed ERR
mkdir
-p
"
$TEMP_PATH
"
mkdir
-p
"
$TEMP_PATH
"
source
"
$DEFINITION_PATH
"
source
"
$DEFINITION_PATH
"
rm
-fr
"
$TEMP_PATH
"
rm
-fr
"
$TEMP_PATH
"
trap
- ERR
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