mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-16 19:21:27 +01:00
Merge branch 'copy-recursive'
This commit is contained in:
commit
5930aa29c0
2 changed files with 43 additions and 2 deletions
|
@ -449,7 +449,7 @@ build_package_mruby() {
|
|||
|
||||
{ rake
|
||||
mkdir -p "$PREFIX_PATH"
|
||||
cp -R build/host/* "$PREFIX_PATH"
|
||||
cp -fR build/host/* "$PREFIX_PATH"
|
||||
cd "$PREFIX_PATH/bin"
|
||||
ln -fs mruby ruby
|
||||
ln -fs mirb irb
|
||||
|
@ -510,7 +510,7 @@ remove_windows_files() {
|
|||
|
||||
build_package_copy() {
|
||||
mkdir -p "$PREFIX_PATH"
|
||||
cp -R . "$PREFIX_PATH"
|
||||
cp -fR . "$PREFIX_PATH"
|
||||
}
|
||||
|
||||
before_install_package() {
|
||||
|
|
|
@ -106,3 +106,44 @@ OUT
|
|||
unstub gmake
|
||||
unstub uname
|
||||
}
|
||||
|
||||
@test "copy strategy forces overwrite" {
|
||||
export RUBY_BUILD_CACHE_PATH="$FIXTURE_ROOT"
|
||||
|
||||
mkdir -p "$INSTALL_ROOT/bin"
|
||||
touch "$INSTALL_ROOT/bin/package"
|
||||
chmod -w "$INSTALL_ROOT/bin/package"
|
||||
|
||||
install_fixture definitions/without-checksum
|
||||
assert_success
|
||||
|
||||
run "$INSTALL_ROOT/bin/package" "world"
|
||||
assert_success "hello world"
|
||||
}
|
||||
|
||||
@test "mruby strategy overwrites non-writable files" {
|
||||
mkdir -p "$RUBY_BUILD_CACHE_PATH"
|
||||
cd "$RUBY_BUILD_CACHE_PATH"
|
||||
mkdir -p "mruby-1.0/build/host/bin"
|
||||
touch "mruby-1.0/build/host/bin"/{mruby,mirb}
|
||||
tar czf "mruby-1.0.tar.gz" "mruby-1.0"
|
||||
|
||||
mkdir -p "$INSTALL_ROOT/bin"
|
||||
touch "$INSTALL_ROOT/bin/mruby"
|
||||
chmod -w "$INSTALL_ROOT/bin/mruby"
|
||||
|
||||
cat > "definition" <<DEF
|
||||
install_package "mruby-1.0" "http://ruby-lang.org/pub/mruby-1.0.tar.gz" mruby
|
||||
DEF
|
||||
|
||||
stub rake true
|
||||
|
||||
run ruby-build "definition" "$INSTALL_ROOT"
|
||||
assert_success
|
||||
|
||||
unstub rake
|
||||
|
||||
assert [ -w "$INSTALL_ROOT/bin/mruby" ]
|
||||
assert [ -e "$INSTALL_ROOT/bin/ruby" ]
|
||||
assert [ -e "$INSTALL_ROOT/bin/irb" ]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue