summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 03:50:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 03:50:47 +0000
commita60a7e81126dcf83435f3ff7a44367c6afab99d0 (patch)
tree9b8e8ec7cb369006d1acbedaefdd53ccb7b4ee39
parentd0f02c7fd15695742af227dede09fad311ed4219 (diff)
make-snapshot: repository options
* tool/make-snapshot: add -svn and -git options to direct the repository to export. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rwxr-xr-xtool/make-snapshot14
1 files changed, 13 insertions, 1 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 1e35d37d2fe..91c44bdf881 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -50,6 +50,7 @@ end
ENV["LC_ALL"] = ENV["LANG"] = "C"
SVNURL = URI.parse("http://svn.ruby-lang.org/repos/ruby/")
+GITURL = URI.parse("git://github.com/ruby/ruby.git")
RUBY_VERSION_PATTERN = /^\#define\s+RUBY_VERSION\s+"([\d.]+)"/
ENV["VPATH"] ||= "include/ruby"
@@ -413,7 +414,18 @@ ensure
FileUtils.rm_rf(v) if v and !$exported and !$keep_temp
end
-vcs = (VCS.detect($srcdir) rescue nil if $srcdir) || VCS::SVN.new(SVNURL)
+if [$srcdir, ($svn||=nil), ($git||=nil)].compact.size > 1
+ abort "#{File.basename $0}: -srcdir, -svn, and -git are exclusive"
+end
+if $srcdir
+ vcs = VCS.detect($srcdir)
+elsif $svn
+ vcs = VCS::SVN.new($svn == true ? SVNURL : URI.parse($svn))
+elsif $git
+ vcs = VCS::GIT.new($git == true ? GITURL : URI.parse($git))
+else
+ vcs = VCS::SVN.new(SVNURL)
+end
success = true
revisions.collect {|rev| package(vcs, rev, destdir, tmp)}.flatten.each do |name|