From 417f27f40f112bdc228b9f2ab27fef8cea7c7d97 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 6 Dec 2016 17:30:10 -0500 Subject: [PATCH] bump-formula-pr: use correct version in download When a --version is specified, use this specified version in the name of the downloaded file rather than the default that is parsed from the URL. For instance, brew bump-formula-pr --devel \ --url=http://www.zsh.org/pub/development/zsh-5.2-test-2.tar.gz \ --version=5.2-test-2 zsh should download to $HOMEBREW_CACHE/zsh-5.2-test-2.tar.gz (correct behavior after this commit) rather than $HOMEBREW_CACHE/zsh-2.tar.gz (wrong behavior before this commit). --- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index c16165b88c..b1f851b8db 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -134,6 +134,7 @@ module Homebrew rsrc = Resource.new { @url = rsrc_url } rsrc.download_strategy = CurlDownloadStrategy rsrc.owner = Resource.new(formula.name) + rsrc.version = forced_version if forced_version rsrc_path = rsrc.fetch if Utils.popen_read("/usr/bin/tar", "-tf", rsrc_path) =~ %r{/.*\.} new_hash = rsrc_path.sha256