Skip to content

Commit

Permalink
download_strategy: use svn info --xml (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladshablinsky authored and xu-cheng committed May 1, 2016
1 parent 3972b90 commit 90d3317
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Library/Homebrew/download_strategy.rb
@@ -1,4 +1,5 @@
require "utils/json"
require "rexml/document"

class AbstractDownloadStrategy
include FileUtils
Expand Down Expand Up @@ -495,7 +496,8 @@ def stage
end

def source_modified_time
Time.parse Utils.popen_read("svn", "info", cached_location.to_s).strip[/^Last Changed Date: (.+)$/, 1]
xml = REXML::Document.new(Utils.popen_read("svn", "info", "--xml", cached_location.to_s))
Time.parse REXML::XPath.first(xml, "//date/text()").to_s
end

private
Expand Down

0 comments on commit 90d3317

Please sign in to comment.