From a60a7e81126dcf83435f3ff7a44367c6afab99d0 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 10 Nov 2016 03:50:47 +0000 Subject: 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 --- tool/make-snapshot | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tool/make-snapshot b/tool/make-snapshot index 1e35d37d2f..91c44bdf88 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| -- cgit v1.2.3