aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBob W. Hogg2017-08-07 18:57:55 -0700
committerBob W. Hogg2017-08-08 23:07:27 -0700
commit0ae22c0e3607ac3c2dba8627541ce275e9b0eb36 (patch)
treec29b8ad7bbd59676e2889c0b0f2bb7d5059f623e /Library
parent33abea9eb3f6ff77e8478c1315e3b9454ca656aa (diff)
downloadbrew-0ae22c0e3607ac3c2dba8627541ce275e9b0eb36.tar.bz2
dev-cmd/bump-formula-pr: search for tar
We first search for gtar in PATH, then check if Homebrew's gtar is available, then finally search for tar in PATH. Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index 1c56749a3..e9e98d450 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -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!"