Merge pull request #4246 from MikeMcQuaid/bzr-downloads

download_strategy: fix bzr --HEAD downloads.
This commit is contained in:
Mike McQuaid 2018-05-31 20:17:55 +01:00 committed by GitHub
commit d7dbbf06bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1089,7 +1089,8 @@ end
class BazaarDownloadStrategy < VCSDownloadStrategy
def initialize(name, resource)
super
@url = @url.sub(%r{^bzr://}, "")
@url.sub!(%r{^bzr://}, "")
ENV["BZR_HOME"] = HOMEBREW_TEMP
end
def stage
@ -1100,7 +1101,9 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
end
def source_modified_time
Time.parse Utils.popen_read("bzr", "log", "-l", "1", "--timezone=utc", cached_location.to_s)[/^timestamp: (.+)$/, 1]
timestamp = Utils.popen_read("bzr", "log", "-l", "1", "--timezone=utc", cached_location.to_s)[/^timestamp: (.+)$/, 1]
raise "Could not get any timestamps from bzr!" if timestamp.to_s.empty?
Time.parse timestamp
end
def last_commit