Merge pull request #3020 from rwhogg/fix-bump-formula-pr-no-usrbintar

dev-cmd/bump-formula-pr: search for tar
This commit is contained in:
ilovezfs 2017-08-08 23:46:56 -07:00 committed by GitHub
commit 0933686dea

View File

@ -176,7 +176,10 @@ module Homebrew
rsrc.version = forced_version if forced_version
odie "No version specified!" unless rsrc.version
rsrc_path = rsrc.fetch
if Utils.popen_read("/usr/bin/tar", "-tf", rsrc_path) =~ %r{/.*\.}
gnu_tar_gtar_path = HOMEBREW_PREFIX/"opt/gnu-tar/bin/gtar"
gnu_tar_gtar = gnu_tar_gtar_path if gnu_tar_gtar_path.executable?
tar = which("gtar") || gnu_tar_gtar || which("tar")
if Utils.popen_read(tar, "-tf", rsrc_path) =~ %r{/.*\.}
new_hash = rsrc_path.sha256
elsif new_url.include? ".tar"
odie "#{formula}: no url/#{hash_type} specified!"