Skip to content

Commit

Permalink
Merge pull request #179334 from Homebrew/b-interpolated-bin-audit
Browse files Browse the repository at this point in the history
b*: Stop interpolating `bin`
  • Loading branch information
p-linnane authored Aug 1, 2024
2 parents 8b27c57 + a511208 commit 2721b39
Show file tree
Hide file tree
Showing 41 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Formula/b/b43-fwcutter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def install
end

test do
system "#{bin}/b43-fwcutter", "--version"
system bin/"b43-fwcutter", "--version"
end
end
2 changes: 1 addition & 1 deletion Formula/b/bashish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def install
end

test do
system "#{bin}/bashish", "list"
system bin/"bashish", "list"
end
end
4 changes: 2 additions & 2 deletions Formula/b/bazarr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def post_install
require "open3"
require "timeout"

system "#{bin}/bazarr", "--help"
system bin/"bazarr", "--help"

config_file = testpath/"config/config.ini"
config_file.write <<~EOS
Expand All @@ -112,7 +112,7 @@ def post_install

port = free_port

Open3.popen3("#{bin}/bazarr", "--no-update", "--config", testpath, "-p", port.to_s) do |_, _, stderr, wait_thr|
Open3.popen3(bin/"bazarr", "--no-update", "--config", testpath, "-p", port.to_s) do |_, _, stderr, wait_thr|
Timeout.timeout(30) do
stderr.each do |line|
refute_match "ERROR", line unless line.match? "Error trying to get releases from Github"
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bazel-remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def install
ENV["BAZEL_REMOTE_MAX_SIZE"] = "10"

begin
pid = fork { exec "#{bin}/bazel-remote" }
pid = fork { exec bin/"bazel-remote" }
sleep 2
assert_predicate testpath/"test", :exist?, "Failed to create test directory"
ensure
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bbe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ def install
end

test do
system "#{bin}/bbe", "--version"
system bin/"bbe", "--version"
end
end
4 changes: 2 additions & 2 deletions Formula/b/bc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def install
end

test do
system "#{bin}/bc", "--version"
assert_match "2", pipe_output("#{bin}/bc", "1+1\n")
system bin/"bc", "--version"
assert_match "2", pipe_output(bin/"bc", "1+1\n")
end
end
2 changes: 1 addition & 1 deletion Formula/b/bchunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def install

touch testpath/"foo.bin"

system "#{bin}/bchunk", "foo.bin", "foo.cue", "foo"
system bin/"bchunk", "foo.bin", "foo.cue", "foo"
assert_predicate testpath/"foo01.iso", :exist?
end
end
2 changes: 1 addition & 1 deletion Formula/b/beancount-language-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def install
}
JSON

Open3.popen3("#{bin}/beancount-language-server", "--stdio") do |stdin, stdout|
Open3.popen3(bin/"beancount-language-server", "--stdio") do |stdin, stdout|
stdin.write "Content-Length: #{json.size}\r\n\r\n#{json}"
assert_match(/^Content-Length: \d+/i, stdout.readline)
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/beanstalkd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def install
end

test do
system "#{bin}/beanstalkd", "-v"
system bin/"beanstalkd", "-v"
end
end
2 changes: 1 addition & 1 deletion Formula/b/beast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def install
return
end

system "#{bin}/beast", "testUCRelaxedClockLogNormal.xml"
system bin/"beast", "testUCRelaxedClockLogNormal.xml"

%w[ops log trees].each do |ext|
output = "testUCRelaxedClockLogNormal." + ext
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bfg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def install
end

test do
system "#{bin}/bfg"
system bin/"bfg"
end
end
2 changes: 1 addition & 1 deletion Formula/b/bgpq3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def install
end

test do
system "#{bin}/bgpq3", "AS-ANY"
system bin/"bgpq3", "AS-ANY"
end
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bibclean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def install
}
EOS

system "#{bin}/bibclean", "test.bib"
system bin/"bibclean", "test.bib"
end
end
2 changes: 1 addition & 1 deletion Formula/b/bindfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def install
end

test do
system "#{bin}/bindfs", "-V"
system bin/"bindfs", "-V"
end
end
2 changes: 1 addition & 1 deletion Formula/b/binwalk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ def install

test do
touch "binwalk.test"
system "#{bin}/binwalk", "binwalk.test"
system bin/"binwalk", "binwalk.test"
end
end
2 changes: 1 addition & 1 deletion Formula/b/bison.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def install
int yylex () { cin.get(c); return c; }
int main() { yyparse(); }
EOS
system "#{bin}/bison", "test.y"
system bin/"bison", "test.y"
system ENV.cxx, "test.tab.c", "-o", "test"
assert_equal "pass", shell_output("echo \"((()(())))()\" | ./test")
assert_equal "fail", shell_output("echo \"())\" | ./test")
Expand Down
4 changes: 2 additions & 2 deletions Formula/b/bitrise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def install
- content: printf 'Test - OK' > brew.test.file
EOS

system "#{bin}/bitrise", "setup"
system "#{bin}/bitrise", "run", "test_wf"
system bin/"bitrise", "setup"
system bin/"bitrise", "run", "test_wf"
assert_equal "Test - OK", (testpath/"brew.test.file").read.chomp
end
end
2 changes: 1 addition & 1 deletion Formula/b/bittwist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def install
end

test do
system "#{bin}/bittwist", "-help"
system bin/"bittwist", "-help"
system "#{bin}/bittwiste", "-help"
end
end
4 changes: 2 additions & 2 deletions Formula/b/bob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def install
mkdir_p "#{testpath}/.local/share/bob"
mkdir_p "#{testpath}/.local/share/nvim-bin"

system "#{bin}/bob", "install", "v0.9.0"
system bin/"bob", "install", "v0.9.0"
assert_match "v0.9.0", shell_output("#{bin}/bob list")
assert_predicate testpath/".local/share/bob/v0.9.0", :exist?
system "#{bin}/bob", "erase"
system bin/"bob", "erase"
end
end
2 changes: 1 addition & 1 deletion Formula/b/bogofilter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def install
end

test do
system "#{bin}/bogofilter", "--version"
system bin/"bogofilter", "--version"
end
end
2 changes: 1 addition & 1 deletion Formula/b/bookloupe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def install
end

test do
ENV["BOOKLOUPE"] = "#{bin}/bookloupe"
ENV["BOOKLOUPE"] = bin/"bookloupe"

Dir["#{pkgshare}/*.tst"].each do |test_file|
# Skip test that fails on macOS
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/boringtun.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def caveats
end

test do
system "#{bin}/boringtun-cli", "--help"
system bin/"boringtun-cli", "--help"
assert_match "boringtun #{version}", shell_output("#{bin}/boringtun-cli -V")

output = shell_output("#{bin}/boringtun-cli utun --foreground 2>&1", 1)
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bowtie2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def install
end

test do
system "#{bin}/bowtie2-build",
system bin/"bowtie2-build",
"#{pkgshare}/example/reference/lambda_virus.fa", "lambda_virus"
assert_predicate testpath/"lambda_virus.1.bt2", :exist?,
"Failed to create viral alignment lambda_virus.1.bt2"
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/boxes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def install
end

test do
assert_match "test brew", pipe_output("#{bin}/boxes", "test brew")
assert_match "test brew", pipe_output(bin/"boxes", "test brew")
end
end
2 changes: 1 addition & 1 deletion Formula/b/bpytop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def install
require "pty"
require "io/console"

r, w, pid = PTY.spawn("#{bin}/bpytop")
r, w, pid = PTY.spawn(bin/"bpytop")
r.winsize = [80, 130]
sleep 5
w.write "\cC"
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/brag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ def install
end

test do
system "#{bin}/brag", "-s", "nntp.perl.org", "-L"
system bin/"brag", "-s", "nntp.perl.org", "-L"
end
end
2 changes: 1 addition & 1 deletion Formula/b/brew-gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def install
end

test do
system "#{bin}/brew-gem", "help"
system bin/"brew-gem", "help"
end
end
2 changes: 1 addition & 1 deletion Formula/b/brew-php-switcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ def install

test do
assert_match "usage: brew-php-switcher version",
shell_output("#{bin}/brew-php-switcher")
shell_output(bin/"brew-php-switcher")
end
end
2 changes: 1 addition & 1 deletion Formula/b/brightness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def install
end

test do
system "#{bin}/brightness", "-l"
system bin/"brightness", "-l"
end
end
2 changes: 1 addition & 1 deletion Formula/b/briss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def install

test do
cp test_fixtures("test.pdf"), testpath
system "#{bin}/briss", "-s", "test.pdf", "-d", "output.pdf"
system bin/"briss", "-s", "test.pdf", "-d", "output.pdf"
assert_predicate testpath/"output.pdf", :exist?
end
end
2 changes: 1 addition & 1 deletion Formula/b/brogue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def caveats
end

test do
system "#{bin}/brogue", "--version"
system bin/"brogue", "--version"
end
end
4 changes: 2 additions & 2 deletions Formula/b/brotli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def install

test do
(testpath/"file.txt").write("Hello, World!")
system "#{bin}/brotli", "file.txt", "file.txt.br"
system "#{bin}/brotli", "file.txt.br", "--output=out.txt", "--decompress"
system bin/"brotli", "file.txt", "file.txt.br"
system bin/"brotli", "file.txt.br", "--output=out.txt", "--decompress"
assert_equal (testpath/"file.txt").read, (testpath/"out.txt").read
end
end
2 changes: 1 addition & 1 deletion Formula/b/bsdiff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def install
(testpath/"bin1").write "\x01\x02\x03\x04"
(testpath/"bin2").write "\x01\x02\x03\x05"

system "#{bin}/bsdiff", "bin1", "bin2", "bindiff"
system bin/"bsdiff", "bin1", "bin2", "bindiff"
end
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bsdmake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def install
\ttouch $@
EOS

system "#{bin}/bsdmake"
system bin/"bsdmake"
assert_predicate testpath/"foo", :exist?
end
end
2 changes: 1 addition & 1 deletion Formula/b/btfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def install
end

test do
system "#{bin}/btfs", "--help"
system bin/"btfs", "--help"
end
end
2 changes: 1 addition & 1 deletion Formula/b/btop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def install
log_level=DEBUG
EOS

r, w, pid = PTY.spawn("#{bin}/btop")
r, w, pid = PTY.spawn(bin/"btop")
r.winsize = [80, 130]
sleep 5
w.write "q"
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/buildifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ def install

test do
touch testpath/"BUILD"
system "#{bin}/buildifier", "-mode=check", "BUILD"
system bin/"buildifier", "-mode=check", "BUILD"
end
end
2 changes: 1 addition & 1 deletion Formula/b/buildozer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def install
build_file = testpath/"BUILD"

touch build_file
system "#{bin}/buildozer", "new java_library brewed", "//:__pkg__"
system bin/"buildozer", "new java_library brewed", "//:__pkg__"

assert_equal "java_library(name = \"brewed\")\n", build_file.read
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/butane.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def install
- ssh-rsa mykey
EOS

system "#{bin}/butane", "--strict", "--output=#{testpath}/example.ign", "#{testpath}/example.bu"
system bin/"butane", "--strict", "--output=#{testpath}/example.ign", "#{testpath}/example.bu"
assert_predicate testpath/"example.ign", :exist?
assert_match(/.*"sshAuthorizedKeys":\["ssh-rsa mykey"\].*/m, File.read(testpath/"example.ign").strip)

Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bvi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def install
out = shell_output("#{bin}/bvi -c q", 1)
assert_match out, "Input is not from a terminal"
else
system "#{bin}/bvi", "-c", "q"
system bin/"bvi", "-c", "q"
end
end
end
2 changes: 1 addition & 1 deletion Formula/b/bzip2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def install

testfilepath.write "TEST CONTENT"

system "#{bin}/bzip2", testfilepath
system bin/"bzip2", testfilepath
system "#{bin}/bunzip2", zipfilepath

assert_equal "TEST CONTENT", testfilepath.read
Expand Down

0 comments on commit 2721b39

Please sign in to comment.