SubversionDownloadStrategy: handle changed repository URL
Fixes Homebrew/homebrew#22159.
This commit is contained in:
parent
94333c64c1
commit
fa5b633650
@ -365,10 +365,16 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
|
|||||||
@clone.join(".svn").directory?
|
@clone.join(".svn").directory?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def repo_url
|
||||||
|
`svn info '#{@clone}' 2>/dev/null`.strip[/^URL: (.+)$/, 1]
|
||||||
|
end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
@url = @url.sub(/^svn\+/, '') if @url =~ %r[^svn\+http://]
|
@url = @url.sub(/^svn\+/, '') if @url =~ %r[^svn\+http://]
|
||||||
ohai "Checking out #{@url}"
|
ohai "Checking out #{@url}"
|
||||||
|
|
||||||
|
clear_cache unless @url.chomp("/") == repo_url or quiet_system 'svn', 'switch', @url, @clone
|
||||||
|
|
||||||
if @clone.exist? and not repo_valid?
|
if @clone.exist? and not repo_valid?
|
||||||
puts "Removing invalid SVN repo from cache"
|
puts "Removing invalid SVN repo from cache"
|
||||||
clear_cache
|
clear_cache
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user