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
f68c8f50
Commit
f68c8f50
authored
May 22, 2012
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #143 from raggi/keep_builds
Add options to keep the build directory around
parents
933b371a
fed031a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
9 deletions
+40
-9
README.md
+8
-0
bin/rbenv-install
+12
-3
bin/ruby-build
+20
-6
No files found.
README.md
View file @
f68c8f50
...
@@ -53,6 +53,14 @@ ruby-build provides an `rbenv-install` command that shortens this to:
...
@@ -53,6 +53,14 @@ ruby-build provides an `rbenv-install` command that shortens this to:
$ rbenv install 1.9.2-p290
$ rbenv install 1.9.2-p290
ruby-build supports $RUBY_BUILD_BUILD_PATH to override the location in which
sources are downloaded and built. The -k/--keep flags will preserve this path
after the build is complete.
rbenv-install also supports the -k/--keep flag, and additionally supports an
environment variable option $RBENV_BUILD_ROOT that when set, will always build
sources under that location, and keep the sources after build completion.
### Version History
### Version History
#### 20120423
#### 20120423
...
...
bin/rbenv-install
View file @
f68c8f50
...
@@ -23,10 +23,20 @@ case "$DEFINITION" in
...
@@ -23,10 +23,20 @@ case "$DEFINITION" in
}
>
&2
}
>
&2
exit
1
exit
1
;;
;;
"-k"
|
"--keep"
)
[
-z
"
${
RBENV_BUILD_ROOT
}
"
]
&&
RBENV_BUILD_ROOT
=
"
${
RBENV_ROOT
}
/srcs"
RUBY_BUILD_OPTIONS+
=
" -k"
;;
esac
esac
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
ruby-build
"
$DEFINITION
"
"
$PREFIX
"
# If RBENV_BUILD_ROOT is set, then always pass keep options to ruby-build
rbenv rehash
if
[
-n
"
${
RBENV_BUILD_ROOT
}
"
]
;
then
\ No newline at end of file
export
RUBY_BUILD_BUILD_PATH
=
"
${
RBENV_BUILD_ROOT
}
/
${
VERSION_NAME
}
"
RUBY_BUILD_OPTIONS+
=
" -k"
fi
ruby-build
"
$DEFINITION
"
"
$PREFIX
"
"
$RUBY_BUILD_OPTIONS
"
rbenv rehash
bin/ruby-build
View file @
f68c8f50
...
@@ -28,8 +28,8 @@ build_failed() {
...
@@ -28,8 +28,8 @@ build_failed() {
echo
"BUILD FAILED"
echo
"BUILD FAILED"
echo
echo
if
!
rmdir
"
${
TEMP
_PATH
}
"
2>/dev/null
;
then
if
!
rmdir
"
${
BUILD
_PATH
}
"
2>/dev/null
;
then
echo
"Inspect or clean up the working tree at
${
TEMP
_PATH
}
"
echo
"Inspect or clean up the working tree at
${
BUILD
_PATH
}
"
if
file_is_not_empty
"
$LOG_PATH
"
;
then
if
file_is_not_empty
"
$LOG_PATH
"
;
then
echo
"Results logged to
${
LOG_PATH
}
"
echo
"Results logged to
${
LOG_PATH
}
"
...
@@ -68,7 +68,7 @@ install_package_using() {
...
@@ -68,7 +68,7 @@ install_package_using() {
local
package_name
=
"
$3
"
local
package_name
=
"
$3
"
shift
3
shift
3
pushd
"
$
TEMP
_PATH
"
>
&4
pushd
"
$
BUILD
_PATH
"
>
&4
"fetch_
${
package_type
}
"
"
$package_name
"
$*
"fetch_
${
package_type
}
"
"
$package_name
"
$*
shift
$((
$package_type_nargs
))
shift
$((
$package_type_nargs
))
make_package
"
$package_name
"
$*
make_package
"
$package_name
"
$*
...
@@ -396,6 +396,15 @@ if [ -z "$PREFIX_PATH" ]; then
...
@@ -396,6 +396,15 @@ if [ -z "$PREFIX_PATH" ]; then
usage
usage
fi
fi
OPTIONS
=
"
$3
"
for
option
in
$OPTIONS
;
do
case
"
$option
"
in
"-k"
|
"--keep"
)
KEEP_BUILD_PATH
=
"y"
;;
esac
done
if
[
-z
"
$TMPDIR
"
]
;
then
if
[
-z
"
$TMPDIR
"
]
;
then
TMP
=
"/tmp"
TMP
=
"/tmp"
else
else
...
@@ -404,10 +413,15 @@ fi
...
@@ -404,10 +413,15 @@ fi
SEED
=
"
$(
date
"+%Y%m%d%H%M%S"
)
.
$$
"
SEED
=
"
$(
date
"+%Y%m%d%H%M%S"
)
.
$$
"
LOG_PATH
=
"
${
TMP
}
/ruby-build.
${
SEED
}
.log"
LOG_PATH
=
"
${
TMP
}
/ruby-build.
${
SEED
}
.log"
TEMP_PATH
=
"
${
TMP
}
/ruby-build.
${
SEED
}
"
RUBY_BIN
=
"
${
PREFIX_PATH
}
/bin/ruby"
RUBY_BIN
=
"
${
PREFIX_PATH
}
/bin/ruby"
CWD
=
"
$(
pwd
)
"
CWD
=
"
$(
pwd
)
"
if
[
-z
$RUBY_BUILD_BUILD_PATH
]
;
then
BUILD_PATH
=
"
${
TMP
}
/ruby-build.
${
SEED
}
"
else
BUILD_PATH
=
$RUBY_BUILD_BUILD_PATH
fi
exec
4<
>
"
$LOG_PATH
"
# open the log file at fd 4
exec
4<
>
"
$LOG_PATH
"
# open the log file at fd 4
if
[
-n
"
$VERBOSE
"
]
;
then
if
[
-n
"
$VERBOSE
"
]
;
then
tail
-f
"
$LOG_PATH
"
&
tail
-f
"
$LOG_PATH
"
&
...
@@ -421,7 +435,7 @@ unset RUBYOPT
...
@@ -421,7 +435,7 @@ unset RUBYOPT
unset
RUBYLIB
unset
RUBYLIB
trap
build_failed ERR
trap
build_failed ERR
mkdir
-p
"
$
TEMP
_PATH
"
mkdir
-p
"
$
BUILD
_PATH
"
source
"
$DEFINITION_PATH
"
source
"
$DEFINITION_PATH
"
rm
-fr
"
$TEMP
_PATH
"
[
-z
"
${
KEEP_BUILD_PATH
}
"
]
&&
rm
-fr
"
$BUILD
_PATH
"
trap
- ERR
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