From 8a1ed0e748baa6bd8ee2a18debd1beee5686020b Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 22 Dec 2014 00:43:02 -0500 Subject: [PATCH] Allow :module => "name" for CVS URLs --- Library/Homebrew/download_strategy.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 9cb56cd218..3f94ccbd15 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -642,6 +642,12 @@ class CVSDownloadStrategy < VCSDownloadStrategy def initialize(name, resource) super @url = @url.sub(%r[^cvs://], "") + + if meta.key?(:module) + @module = meta.fetch(:module) + else + @module, @url = split_url(@url) + end end def stage @@ -659,15 +665,9 @@ class CVSDownloadStrategy < VCSDownloadStrategy end def clone_repo - # URL of cvs cvs://:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML:gccxml - # will become: - # cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login - # cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml - mod, url = split_url(@url) - HOMEBREW_CACHE.cd do - quiet_safe_system cvspath, { :quiet_flag => "-Q" }, "-d", url, "login" - quiet_safe_system cvspath, { :quiet_flag => "-Q" }, "-d", url, "checkout", "-d", cache_filename, mod + quiet_safe_system cvspath, { :quiet_flag => "-Q" }, "-d", @url, "login" + quiet_safe_system cvspath, { :quiet_flag => "-Q" }, "-d", @url, "checkout", "-d", cache_filename, @module end end