2017-06-28 06:18:03 -04:00
|
|
|
# sync following repositories to ruby repository
|
|
|
|
#
|
|
|
|
# * https://github.com/rubygems/rubygems
|
2018-11-02 19:07:56 -04:00
|
|
|
# * https://github.com/bundler/bundler
|
2017-08-29 07:52:50 -04:00
|
|
|
# * https://github.com/ruby/rdoc
|
2019-04-27 01:53:09 -04:00
|
|
|
# * https://github.com/ruby/reline
|
2017-06-28 06:18:03 -04:00
|
|
|
# * https://github.com/flori/json
|
|
|
|
# * https://github.com/ruby/psych
|
|
|
|
# * https://github.com/ruby/fileutils
|
|
|
|
# * https://github.com/ruby/fiddle
|
|
|
|
# * https://github.com/ruby/stringio
|
|
|
|
# * https://github.com/ruby/io-console
|
|
|
|
# * https://github.com/ruby/csv
|
|
|
|
# * https://github.com/ruby/webrick
|
|
|
|
# * https://github.com/ruby/dbm
|
|
|
|
# * https://github.com/ruby/gdbm
|
|
|
|
# * https://github.com/ruby/sdbm
|
|
|
|
# * https://github.com/ruby/etc
|
|
|
|
# * https://github.com/ruby/date
|
|
|
|
# * https://github.com/ruby/zlib
|
|
|
|
# * https://github.com/ruby/fcntl
|
|
|
|
# * https://github.com/ruby/scanf
|
|
|
|
# * https://github.com/ruby/cmath
|
|
|
|
# * https://github.com/ruby/strscan
|
2017-08-01 22:20:48 -04:00
|
|
|
# * https://github.com/ruby/ipaddr
|
2018-06-11 03:42:28 -04:00
|
|
|
# * https://github.com/ruby/logger
|
|
|
|
# * https://github.com/ruby/prime
|
|
|
|
# * https://github.com/ruby/matrix
|
|
|
|
# * https://github.com/ruby/ostruct
|
|
|
|
# * https://github.com/ruby/rexml
|
|
|
|
# * https://github.com/ruby/rss
|
2018-07-09 10:01:05 -04:00
|
|
|
# * https://github.com/ruby/irb
|
2018-07-17 08:21:29 -04:00
|
|
|
# * https://github.com/ruby/sync
|
2018-07-19 21:25:59 -04:00
|
|
|
# * https://github.com/ruby/tracer
|
2018-07-19 22:24:59 -04:00
|
|
|
# * https://github.com/ruby/shell
|
2018-07-25 07:53:57 -04:00
|
|
|
# * https://github.com/ruby/forwardable
|
2018-07-25 08:15:45 -04:00
|
|
|
# * https://github.com/ruby/thwait
|
2018-07-25 08:26:41 -04:00
|
|
|
# * https://github.com/ruby/e2mmap
|
2018-07-25 08:28:17 -04:00
|
|
|
# * https://github.com/ruby/mutex_m
|
2017-06-28 06:18:03 -04:00
|
|
|
#
|
|
|
|
|
2017-07-02 22:13:59 -04:00
|
|
|
$repositories = {
|
2017-06-28 06:18:03 -04:00
|
|
|
rubygems: 'rubygems/rubygems',
|
2018-11-02 19:07:56 -04:00
|
|
|
bundler: 'bundler/bundler',
|
2017-08-29 07:52:50 -04:00
|
|
|
rdoc: 'ruby/rdoc',
|
2019-04-27 01:53:09 -04:00
|
|
|
reline: 'ruby/reline',
|
2017-06-28 06:18:03 -04:00
|
|
|
json: 'flori/json',
|
2017-07-14 01:33:15 -04:00
|
|
|
psych: 'ruby/psych',
|
2017-06-28 06:18:03 -04:00
|
|
|
fileutils: 'ruby/fileutils',
|
|
|
|
fiddle: 'ruby/fiddle',
|
|
|
|
stringio: 'ruby/stringio',
|
|
|
|
ioconsole: 'ruby/io-console',
|
|
|
|
csv: 'ruby/csv',
|
|
|
|
webrick: 'ruby/webrick',
|
|
|
|
dbm: 'ruby/dbm',
|
|
|
|
gdbm: 'ruby/gdbm',
|
|
|
|
sdbm: 'ruby/sdbm',
|
|
|
|
etc: 'ruby/etc',
|
|
|
|
date: 'ruby/date',
|
|
|
|
zlib: 'ruby/zlib',
|
|
|
|
fcntl: 'ruby/fcntl',
|
|
|
|
scanf: 'ruby/scanf',
|
|
|
|
cmath: 'ruby/cmath',
|
|
|
|
strscan: 'ruby/strscan',
|
2017-08-01 22:20:48 -04:00
|
|
|
ipaddr: 'ruby/ipaddr',
|
2018-06-11 03:42:28 -04:00
|
|
|
logger: 'ruby/logger',
|
|
|
|
prime: 'ruby/prime',
|
|
|
|
matrix: 'ruby/matrix',
|
|
|
|
ostruct: 'ruby/ostruct',
|
|
|
|
rexml: 'ruby/rexml',
|
|
|
|
rss: 'ruby/rss',
|
2018-07-09 10:01:05 -04:00
|
|
|
irb: 'ruby/irb',
|
2018-07-19 21:25:59 -04:00
|
|
|
sync: 'ruby/sync',
|
2018-07-19 22:24:59 -04:00
|
|
|
tracer: 'ruby/tracer',
|
2018-07-25 07:53:57 -04:00
|
|
|
shell: 'ruby/shell',
|
2018-07-25 08:15:45 -04:00
|
|
|
forwardable: "ruby/forwardable",
|
2018-07-25 08:26:41 -04:00
|
|
|
thwait: "ruby/thwait",
|
2018-07-25 08:28:17 -04:00
|
|
|
e2mmap: "ruby/e2mmap",
|
|
|
|
mutex_m: "ruby/mutex_m"
|
2017-06-28 06:18:03 -04:00
|
|
|
}
|
|
|
|
|
2017-07-02 22:13:59 -04:00
|
|
|
def sync_default_gems(gem)
|
|
|
|
puts "Sync #{$repositories[gem.to_sym]}"
|
|
|
|
|
|
|
|
case gem
|
|
|
|
when "rubygems"
|
2017-09-24 03:52:25 -04:00
|
|
|
`rm -rf lib/rubygems* test/rubygems`
|
2017-07-02 22:13:59 -04:00
|
|
|
`cp -r ../../rubygems/rubygems/lib/rubygems* ./lib`
|
|
|
|
`cp -r ../../rubygems/rubygems/test/rubygems ./test`
|
2018-11-02 19:07:56 -04:00
|
|
|
when "bundler"
|
2019-04-18 08:56:47 -04:00
|
|
|
`rm -rf lib/bundler* libexec/bundler libexec/bundle spec/bundler man/bundle* man/gemfile*`
|
2018-11-02 19:07:56 -04:00
|
|
|
`cp -r ../../bundler/bundler/lib/bundler* ./lib`
|
2018-11-25 20:43:02 -05:00
|
|
|
`cp -r ../../bundler/bundler/exe/bundle* ./libexec`
|
2019-02-02 05:41:22 -05:00
|
|
|
`cp ../../bundler/bundler/bundler.gemspec ./lib/bundler`
|
2018-11-02 19:07:56 -04:00
|
|
|
`cp -r ../../bundler/bundler/spec spec/bundler`
|
|
|
|
`cp -r ../../bundler/bundler/man/*.{1,5,1\.txt,5\.txt,ronn} ./man`
|
2018-11-07 12:18:14 -05:00
|
|
|
`rm -rf spec/bundler/support/artifice/vcr_cassettes`
|
2017-07-02 22:13:59 -04:00
|
|
|
when "rdoc"
|
2018-11-26 07:23:45 -05:00
|
|
|
`rm -rf lib/rdoc* test/rdoc libexec/rdoc libexec/ri`
|
2017-08-29 07:52:50 -04:00
|
|
|
`cp -rf ../rdoc/lib/rdoc* ./lib`
|
|
|
|
`cp -rf ../rdoc/test test/rdoc`
|
|
|
|
`cp ../rdoc/rdoc.gemspec ./lib/rdoc`
|
2018-11-26 07:23:45 -05:00
|
|
|
`cp -rf ../rdoc/exe/rdoc ./libexec`
|
|
|
|
`cp -rf ../rdoc/exe/ri ./libexec`
|
2017-07-02 22:13:59 -04:00
|
|
|
`rm -f lib/rdoc/markdown.kpeg lib/rdoc/markdown/literals.kpeg lib/rdoc/rd/block_parser.ry lib/rdoc/rd/inline_parser.ry`
|
2017-08-29 07:52:50 -04:00
|
|
|
`git checkout lib/rdoc/.document`
|
2019-04-27 01:53:09 -04:00
|
|
|
when "reline"
|
|
|
|
`rm -rf lib/reline* test/reline`
|
|
|
|
`cp -rf ../reline/lib/reline* ./lib`
|
|
|
|
`cp -rf ../reline/test test/reline`
|
|
|
|
`cp ../reline/reline.gemspec ./lib/reline`
|
2017-07-02 22:13:59 -04:00
|
|
|
when "json"
|
|
|
|
`rm -rf ext/json test/json`
|
|
|
|
`cp -rf ../../flori/json/ext/json/ext ext/json`
|
|
|
|
`cp -rf ../../flori/json/tests test/json`
|
|
|
|
`cp -rf ../../flori/json/lib ext/json`
|
|
|
|
`rm -rf ext/json/lib/json/pure*`
|
|
|
|
`cp ../../flori/json/json.gemspec ext/json`
|
|
|
|
`rm -r ext/json/lib/json/ext`
|
|
|
|
`git checkout ext/json/extconf.rb ext/json/parser/prereq.mk ext/json/generator/depend ext/json/parser/depend`
|
|
|
|
when "psych"
|
|
|
|
`rm -rf ext/psych test/psych`
|
|
|
|
`cp -rf ../psych/ext/psych ./ext`
|
|
|
|
`cp -rf ../psych/lib ./ext/psych`
|
|
|
|
`cp -rf ../psych/test/psych ./test`
|
2017-07-14 01:33:15 -04:00
|
|
|
`rm -rf ext/psych/lib/org ext/psych/lib/psych.jar ext/psych/lib/psych_jars.rb`
|
|
|
|
`rm -rf ext/psych/lib/psych.{bundle,so} ext/psych/lib/{2.0,2.1,2.2,2.3,2.4}`
|
2017-09-22 22:55:07 -04:00
|
|
|
`rm -f ext/psych/yaml/LICENSE`
|
2017-07-02 22:13:59 -04:00
|
|
|
`cp ../psych/psych.gemspec ext/psych/`
|
2017-07-14 01:33:15 -04:00
|
|
|
`git checkout ext/psych/depend`
|
2017-07-02 22:13:59 -04:00
|
|
|
when "fiddle"
|
|
|
|
`rm -rf ext/fiddle test/fiddle`
|
|
|
|
`cp -rf ../fiddle/ext/fiddle ext`
|
|
|
|
`cp -rf ../fiddle/lib ext/fiddle`
|
|
|
|
`cp -rf ../fiddle/test/fiddle test`
|
|
|
|
`cp -f ../fiddle/fiddle.gemspec ext/fiddle`
|
|
|
|
`git checkout ext/fiddle/depend`
|
2018-10-20 03:21:14 -04:00
|
|
|
`rm -rf ext/fiddle/lib/fiddle.{bundle,so}`
|
2017-07-02 22:13:59 -04:00
|
|
|
when "stringio"
|
|
|
|
`rm -rf ext/stringio test/stringio`
|
|
|
|
`cp -rf ../stringio/ext/stringio ext`
|
|
|
|
`cp -rf ../stringio/test/stringio test`
|
|
|
|
`cp -f ../stringio/stringio.gemspec ext/stringio`
|
|
|
|
`git checkout ext/stringio/depend ext/stringio/README.md`
|
|
|
|
when "ioconsole"
|
|
|
|
`rm -rf ext/io/console test/io/console`
|
|
|
|
`cp -rf ../io-console/ext/io/console ext/io`
|
|
|
|
`cp -rf ../io-console/test/io/console test/io`
|
|
|
|
`mkdir -p ext/io/console/lib`
|
|
|
|
`cp -rf ../io-console/lib/console ext/io/console/lib`
|
|
|
|
`cp -f ../io-console/io-console.gemspec ext/io/console`
|
|
|
|
`git checkout ext/io/console/depend`
|
|
|
|
when "dbm"
|
|
|
|
`rm -rf ext/dbm test/dbm`
|
|
|
|
`cp -rf ../dbm/ext/dbm ext`
|
|
|
|
`cp -rf ../dbm/test/dbm test`
|
|
|
|
`cp -f ../dbm/dbm.gemspec ext/dbm`
|
|
|
|
`git checkout ext/dbm/depend`
|
|
|
|
when "gdbm"
|
|
|
|
`rm -rf ext/gdbm test/gdbm`
|
|
|
|
`cp -rf ../gdbm/ext/gdbm ext`
|
|
|
|
`cp -rf ../gdbm/test/gdbm test`
|
|
|
|
`cp -f ../gdbm/gdbm.gemspec ext/gdbm`
|
|
|
|
`git checkout ext/gdbm/depend ext/gdbm/README`
|
|
|
|
when "sdbm"
|
|
|
|
`rm -rf ext/sdbm test/sdbm`
|
|
|
|
`cp -rf ../sdbm/ext/sdbm ext`
|
|
|
|
`cp -rf ../sdbm/test/sdbm test`
|
|
|
|
`cp -f ../sdbm/sdbm.gemspec ext/sdbm`
|
|
|
|
`git checkout ext/sdbm/depend`
|
|
|
|
when "etc"
|
|
|
|
`rm -rf ext/etc test/etc`
|
|
|
|
`cp -rf ../etc/ext/etc ext`
|
|
|
|
`cp -rf ../etc/test/etc test`
|
|
|
|
`cp -f ../etc/etc.gemspec ext/etc`
|
|
|
|
`git checkout ext/etc/depend`
|
|
|
|
when "date"
|
|
|
|
`rm -rf ext/date test/date`
|
|
|
|
`cp -rf ../date/ext/date ext`
|
|
|
|
`cp -rf ../date/lib ext/date`
|
|
|
|
`cp -rf ../date/test/date test`
|
|
|
|
`cp -f ../date/date.gemspec ext/date`
|
|
|
|
`git checkout ext/date/depend`
|
2018-08-06 01:01:08 -04:00
|
|
|
`rm -f ext/date/lib/date_core.bundle`
|
2017-07-02 22:13:59 -04:00
|
|
|
when "zlib"
|
|
|
|
`rm -rf ext/zlib test/zlib`
|
|
|
|
`cp -rf ../zlib/ext/zlib ext`
|
|
|
|
`cp -rf ../zlib/test/zlib test`
|
|
|
|
`cp -f ../zlib/zlib.gemspec ext/zlib`
|
|
|
|
`git checkout ext/zlib/depend`
|
|
|
|
when "fcntl"
|
|
|
|
`rm -rf ext/fcntl`
|
|
|
|
`cp -rf ../fcntl/ext/fcntl ext`
|
|
|
|
`cp -f ../fcntl/fcntl.gemspec ext/fcntl`
|
|
|
|
`git checkout ext/fcntl/depend`
|
2018-07-25 08:15:45 -04:00
|
|
|
when "thwait"
|
|
|
|
`rm -rf lib/thwait*`
|
|
|
|
`cp -rf ../thwait/lib/* lib`
|
2018-07-31 08:25:24 -04:00
|
|
|
`cp -rf ../thwait/thwait.gemspec lib/thwait`
|
2018-07-25 08:26:41 -04:00
|
|
|
when "e2mmap"
|
|
|
|
`rm -rf lib/e2mmap*`
|
|
|
|
`cp -rf ../e2mmap/lib/* lib`
|
|
|
|
`cp -rf ../e2mmap/e2mmap.gemspec lib`
|
2017-07-02 22:13:59 -04:00
|
|
|
when "strscan"
|
|
|
|
`rm -rf ext/strscan test/strscan`
|
|
|
|
`cp -rf ../strscan/ext/strscan ext`
|
|
|
|
`cp -rf ../strscan/test/strscan test`
|
|
|
|
`cp -f ../strscan/strscan.gemspec ext/strscan`
|
|
|
|
`rm -f ext/strscan/regenc.h ext/strscan/regint.h`
|
|
|
|
`git checkout ext/strscan/depend`
|
2018-07-31 07:48:09 -04:00
|
|
|
when "rexml", "rss", "matrix", "irb", "csv", "shell", "logger", "ostruct", "scanf", "webrick", "fileutils", "forwardable", "prime", "tracer", "ipaddr", "cmath", "mutex_m", "sync"
|
2018-07-17 07:39:16 -04:00
|
|
|
sync_lib gem
|
2017-07-02 22:13:59 -04:00
|
|
|
else
|
|
|
|
end
|
2017-06-28 06:18:03 -04:00
|
|
|
end
|
|
|
|
|
2018-07-17 07:39:16 -04:00
|
|
|
def sync_lib(repo)
|
2019-04-26 05:18:09 -04:00
|
|
|
unless File.directory?("../#{repo}")
|
|
|
|
abort "Expected '../#{repo}' (#{File.expand_path("../#{repo}")}) to be a directory, but it wasn't."
|
|
|
|
end
|
2018-07-31 08:05:24 -04:00
|
|
|
`rm -rf lib/#{repo}.rb lib/#{repo}/* test/test_#{repo}.rb`
|
2018-07-17 07:39:16 -04:00
|
|
|
`cp -rf ../#{repo}/lib/* lib`
|
2018-07-25 07:53:57 -04:00
|
|
|
tests = if File.directory?("test/#{repo}")
|
|
|
|
"test/#{repo}"
|
|
|
|
else
|
|
|
|
"test/test_#{repo}.rb"
|
|
|
|
end
|
|
|
|
`cp -rf ../#{repo}/#{tests} test`
|
2018-07-25 07:47:04 -04:00
|
|
|
gemspec = if File.directory?("lib/#{repo}")
|
|
|
|
"lib/#{repo}/#{repo}.gemspec"
|
|
|
|
else
|
|
|
|
"lib/#{repo}.gemspec"
|
|
|
|
end
|
|
|
|
`cp -f ../#{repo}/#{repo}.gemspec #{gemspec}`
|
2018-07-17 07:39:16 -04:00
|
|
|
end
|
|
|
|
|
2018-10-25 06:16:28 -04:00
|
|
|
def update_default_gems(gem)
|
|
|
|
author, repository = $repositories[gem.to_sym].split('/')
|
|
|
|
|
|
|
|
unless File.exist?("../../#{author}/#{repository}")
|
|
|
|
`mkdir -p ../../#{author}`
|
|
|
|
`git clone git@github.com:#{author}/#{repository}.git ../../#{author}/#{repository}`
|
|
|
|
end
|
|
|
|
|
|
|
|
Dir.chdir("../../#{author}/#{repository}") do
|
|
|
|
unless `git remote`.match(/ruby\-core/)
|
|
|
|
`git remote add ruby-core git@github.com:ruby/ruby.git`
|
|
|
|
`git fetch ruby-core`
|
|
|
|
`git co ruby-core/trunk`
|
|
|
|
`git branch ruby-core`
|
|
|
|
end
|
|
|
|
`git co ruby-core`
|
|
|
|
`git fetch ruby-core trunk`
|
|
|
|
`git rebase ruby-core/trunk`
|
|
|
|
`git co master`
|
|
|
|
`git stash`
|
|
|
|
`git pull --rebase`
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
case ARGV[0]
|
|
|
|
when "up"
|
|
|
|
$repositories.keys.each{|gem| update_default_gems(gem.to_s)}
|
|
|
|
when "all"
|
2017-07-02 22:13:59 -04:00
|
|
|
$repositories.keys.each{|gem| sync_default_gems(gem.to_s)}
|
2018-10-25 06:16:28 -04:00
|
|
|
else
|
|
|
|
sync_default_gems(ARGV[0])
|
2017-06-28 06:18:03 -04:00
|
|
|
end
|