Allow :module => "name" for CVS URLs

This commit is contained in:
Jack Nagel 2014-12-22 00:43:02 -05:00
parent 69b01772cc
commit 8a1ed0e748

View File

@ -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