Skip to content

Commit

Permalink
Fix sync_ruby to work properly with our forked branch names (which ar…
Browse files Browse the repository at this point in the history
…e not dotted) and handle running from another directory.
  • Loading branch information
headius committed Jun 4, 2010
1 parent c3329e4 commit d551d0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tool/sync_ruby
Expand Up @@ -15,6 +15,7 @@ class Sync
include FileUtils

def initialize(version, source, target)
@named_version = version
@version = format_version(version)
@source = source
@target = target
Expand All @@ -29,7 +30,7 @@ class Sync
end

def sync_stdlib
load "globals_#{@version}.rb"
load File.dirname(__FILE__) + "/globals_#{@named_version}.rb"

for file in STDLIB_FILES
cp_r "#{@source}/lib/#{file}", "#{@target}/lib/ruby/#{@version}", :verbose => true
Expand Down Expand Up @@ -57,7 +58,7 @@ class Sync

def checkout(source, version)
cd(source) do
branch = "jruby-ruby_#{version}"
branch = "jruby-ruby_#{@named_version}"

if (branches = `git branch | sed 's/[\*\s]*//'`).split("\n").include? branch
`git checkout #{branch}`
Expand Down

0 comments on commit d551d0f

Please sign in to comment.