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
e9129e5a
Commit
e9129e5a
authored
Oct 19, 2011
by
Sam Stephenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rbenv-install tries to install packages by default, then falls back to building
parent
972498d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
18 deletions
+67
-18
TODO
+1
-1
bin/rbenv-install
+65
-16
libexec/ruby-package-fetch
+1
-1
No files found.
TODO
View file @
e9129e5a
...
@@ -5,4 +5,4 @@ X Better error messages
...
@@ -5,4 +5,4 @@ X Better error messages
X Show 'Downloading' and 'Installing' messages a la ruby-build
X Show 'Downloading' and 'Installing' messages a la ruby-build
* Rewrite RbConfig::CONFIG['CC'] on install
* Rewrite RbConfig::CONFIG['CC'] on install
* Patch rbx since the rewriter doesn't work there
* Patch rbx since the rewriter doesn't work there
*
rbenv-install should check for binary packages before building
X
rbenv-install should check for binary packages before building
bin/rbenv-install
View file @
e9129e5a
...
@@ -2,19 +2,26 @@
...
@@ -2,19 +2,26 @@
set
-
e
set
-
e
[
-
n
"$RBENV_DEBUG"
]
&&
set
-
x
[
-
n
"$RBENV_DEBUG"
]
&&
set
-
x
# Provide rbenv completions
resolve_link
()
{
if
[
"
$1
"
=
"--complete"
]
;
then
$(
type
-
p
greadlink
readlink
|
head
-
1
)
$
1
exec
ruby-build
--definitions
}
fi
if
[
-z
"
$RBENV_ROOT
"
]
;
then
abs_dirname
()
{
RBENV_ROOT
=
"
${
HOME
}
/.rbenv
"
local
cwd
=
"$(pwd)
"
fi
local
path
=
"$1"
DEFINITION
=
"
$1
"
while
[
-
n
"$path"
];
do
case
"
$DEFINITION
"
in
cd
"${path%/*}"
""
|
-
*
)
local
name
=
"${path##*/}"
{
echo
"usage: rbenv install VERSION"
path
=
"$(resolve_link "
$
name
" || true)"
done
pwd
cd
"$cwd"
}
usage
()
{
{
echo
"usage: rbenv install [--force-build | --force-package] VERSION"
echo
" rbenv install /path/to/definition"
echo
" rbenv install /path/to/definition"
echo
echo
echo
"Available versions:"
echo
"Available versions:"
...
@@ -22,11 +29,54 @@ case "$DEFINITION" in
...
@@ -22,11 +29,54 @@ case "$DEFINITION" in
echo
echo
}
>&
2
}
>&
2
exit
1
exit
1
}
bin_dir
=
"$(abs_dirname "
$
0
")"
export
PATH
=
"${bin_dir}:$PATH"
#
Provide
rbenv
completions
if
[
"$1"
=
"--complete"
];
then
exec
ruby
-
build
--
definitions
fi
force_build
=
""
force_package
=
""
if
[
"$1"
=
"--force-build"
];
then
force_build
=
1
shift
elif
[
"$1"
=
"--force-package"
];
then
force_package
=
1
shift
fi
definition
=
"$1"
case
"$definition"
in
""
|
-*
)
usage
;;
;;
esac
esac
VERSION_NAME
=
"
${
DEFINITION
##*/
}
"
if
[
-
z
"$RBENV_ROOT"
];
then
PREFIX
=
"
${
RBENV_ROOT
}
/versions/
${
VERSION_NAME
}
"
RBENV_ROOT
=
"${HOME}/.rbenv"
fi
version_name
=
"${definition##*/}"
prefix
=
"${RBENV_ROOT}/versions/${version_name}"
package
()
{
ruby
-
package
install
$*
"$definition"
"$prefix"
}
build
()
{
ruby
-
build
"$definition"
"$prefix"
}
if
[
-
n
"$force_build"
];
then
build
elif
[
-
n
"$force_package"
];
then
package
else
package
--
fail
-
silently
||
build
fi
ruby-build
"
$DEFINITION
"
"
$PREFIX
"
rbenv
rehash
rbenv rehash
\ No newline at end of file
libexec/ruby-package-fetch
View file @
e9129e5a
...
@@ -66,7 +66,7 @@ else
...
@@ -66,7 +66,7 @@ else
package_filename
=
"
${
TMPDIR
}
/
${
package_name
}
.
$$
"
package_filename
=
"
${
TMPDIR
}
/
${
package_name
}
.
$$
"
echo
"Downloading
$package_url
..."
>
&2
echo
"Downloading
$package_url
..."
>
&2
download
"
$package_url
"
"
$package_filename
"
||
{
download
"
$package_url
"
"
$package_filename
"
||
{
echo
"error: couldn't
fetch
package
\`
$package
' (
$package_url
)"
echo
"error: couldn't
download
package
\`
$package
' (
$package_url
)"
exit
1
exit
1
}
>
&2
}
>
&2
fi
fi
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