Skip to content

Commit

Permalink
Merge pull request #179414 from Homebrew/e-bin-audit-followup
Browse files Browse the repository at this point in the history
e-h*: Stop interpolating `bin`
  • Loading branch information
p-linnane authored Aug 2, 2024
2 parents e88ddc5 + 4d7b7e6 commit b00797a
Show file tree
Hide file tree
Showing 86 changed files with 182 additions and 149 deletions.
2 changes: 1 addition & 1 deletion Formula/e/easy-tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def post_install
# Gtk-WARNING **: 18:38:23.471: cannot open display
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]

system "#{bin}/easytag", "--version"
system bin/"easytag", "--version"
end
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/e/ebook-tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ def install
end

test do
system "#{bin}/einfo", "-help"
system bin/"einfo", "-help"
end
end
2 changes: 0 additions & 2 deletions Formula/e/ecflow-ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ def install
binary_version_out = shell_output("#{bin}/ecflow_ui.x --version")
assert_match @version.to_s, binary_version_out

# check that the startup script runs
system "#{bin}/ecflow_ui", "-h"
help_out = shell_output("#{bin}/ecflow_ui -h")
assert_match "ecFlowUI", help_out
assert_match "fontsize", help_out
Expand Down
2 changes: 1 addition & 1 deletion Formula/e/eot-utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def install

test do
resource("eot").stage do
system "#{bin}/eotinfo", "pixelambacht-dash.eot"
system bin/"eotinfo", "pixelambacht-dash.eot"
end
end
end
4 changes: 3 additions & 1 deletion Formula/e/erlang.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def caveats
test do
assert_equal version, resource("html").version, "`html` resource needs updating!"

system "#{bin}/erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"
system bin/"erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"

(testpath/"factorial").write <<~EOS
#!#{bin}/escript
%% -*- erlang -*-
Expand All @@ -114,6 +115,7 @@ def caveats
fac(0) -> 1;
fac(N) -> N * fac(N-1).
EOS

chmod 0755, "factorial"
assert_match "usage: factorial integer", shell_output("./factorial")
assert_match "factorial 42 = 1405006117752879898543142606244511569936384000000000", shell_output("./factorial 42")
Expand Down
4 changes: 3 additions & 1 deletion Formula/e/erlang@22.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def caveats
end

test do
system "#{bin}/erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"
system bin/"erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"

(testpath/"factorial").write <<~EOS
#!#{bin}/escript
%% -*- erlang -*-
Expand All @@ -103,6 +104,7 @@ def caveats
fac(0) -> 1;
fac(N) -> N * fac(N-1).
EOS

chmod 0755, "factorial"
assert_match "usage: factorial integer", shell_output("./factorial")
assert_match "factorial 42 = 1405006117752879898543142606244511569936384000000000", shell_output("./factorial 42")
Expand Down
4 changes: 3 additions & 1 deletion Formula/e/erlang@24.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def caveats
end

test do
system "#{bin}/erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"
system bin/"erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"

(testpath/"factorial").write <<~EOS
#!#{bin}/escript
%% -*- erlang -*-
Expand All @@ -112,6 +113,7 @@ def caveats
fac(0) -> 1;
fac(N) -> N * fac(N-1).
EOS

chmod 0755, "factorial"
assert_match "usage: factorial integer", shell_output("./factorial")
assert_match "factorial 42 = 1405006117752879898543142606244511569936384000000000", shell_output("./factorial 42")
Expand Down
4 changes: 3 additions & 1 deletion Formula/e/erlang@25.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def caveats
end

test do
system "#{bin}/erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"
system bin/"erl", "-noshell", "-eval", "crypto:start().", "-s", "init", "stop"

(testpath/"factorial").write <<~EOS
#!#{bin}/escript
%% -*- erlang -*-
Expand All @@ -109,6 +110,7 @@ def caveats
fac(0) -> 1;
fac(N) -> N * fac(N-1).
EOS

chmod 0755, "factorial"
assert_match "usage: factorial integer", shell_output("./factorial")
assert_match "factorial 42 = 1405006117752879898543142606244511569936384000000000", shell_output("./factorial 42")
Expand Down
4 changes: 2 additions & 2 deletions Formula/e/erofs-utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def install

# Test mkfs.erofs can make a valid erofsimg.
# (Also tests that `lz4` support is properly linked.)
system "#{bin}/mkfs.erofs", "--quiet", "-zlz4", "test.lz4.erofs", "in"
system bin/"mkfs.erofs", "--quiet", "-zlz4", "test.lz4.erofs", "in"
assert_predicate testpath/"test.lz4.erofs", :exist?

# Test mkfs.erofs can make a valid erofsimg.
# (Also tests that `lzma` support is properly linked.)
system "#{bin}/mkfs.erofs", "--quiet", "-zlzma", "test.lzma.erofs", "in"
system bin/"mkfs.erofs", "--quiet", "-zlzma", "test.lzma.erofs", "in"
assert_predicate testpath/"test.lzma.erofs", :exist?

# Unfortunately, fsck.erofs doesn't support extraction for now, and
Expand Down
3 changes: 2 additions & 1 deletion Formula/e/ethereum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def install
"alloc": {}
}
EOS
system "#{bin}/geth", "--datadir", "testchain", "init", "genesis.json"

system bin/"geth", "--datadir", "testchain", "init", "genesis.json"
assert_predicate testpath/"testchain/geth/chaindata/000002.log", :exist?
assert_predicate testpath/"testchain/geth/lightchaindata/000002.log", :exist?
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/e/exact-image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def install
end

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

test do
system "#{bin}/searchsploit", "sendpage"
system bin/"searchsploit", "sendpage"
end
end
2 changes: 1 addition & 1 deletion Formula/f/f3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def install
end

test do
system "#{bin}/f3read", testpath
system bin/"f3read", testpath
end
end
2 changes: 1 addition & 1 deletion Formula/f/fastjar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ def install

test do
system bin/"fastjar", "-V"
system "#{bin}/grepjar", "-V"
system bin/"grepjar", "-V"
end
end
2 changes: 1 addition & 1 deletion Formula/f/fcitx-remote-for-osx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def install
end

test do
system "#{bin}/fcitx-remote", "-n"
system bin/"fcitx-remote", "-n"
end
end
2 changes: 1 addition & 1 deletion Formula/f/fdk-aac-encoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def install
f.syswrite(samples.flatten.pack("s*"))
end

system "#{bin}/fdkaac", "-R", "--raw-channels", "1", "-m",
system bin/"fdkaac", "-R", "--raw-channels", "1", "-m",
"1", "#{testpath}/tone.pcm", "--title", "Test Tone"
end
end
2 changes: 1 addition & 1 deletion Formula/f/fdk-aac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def install
end

test do
system "#{bin}/aac-enc", test_fixtures("test.wav"), "test.aac"
system bin/"aac-enc", test_fixtures("test.wav"), "test.aac"
assert_predicate testpath/"test.aac", :exist?
end
end
2 changes: 1 addition & 1 deletion Formula/f/ficy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ def install

test do
cp test_fixtures("test.mp3"), testpath
system "#{bin}/fResync", "-n", "1", "test.mp3"
system bin/"fResync", "-n", "1", "test.mp3"
end
end
2 changes: 1 addition & 1 deletion Formula/f/file-formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def install
end

test do
system "#{bin}/file", test_fixtures("test.mp3")
system bin/"file", test_fixtures("test.mp3")
end
end

Expand Down
3 changes: 2 additions & 1 deletion Formula/f/findent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ def install
test do
cp_r pkgshare/"test/progfree.f.in", testpath
cp_r pkgshare/"test/progfree.f.try.f.ref", testpath

flags = File.open(testpath/"progfree.f.in", &:readline).sub(/ *! */, "").chomp
system "#{bin}/findent #{flags} < progfree.f.in > progfree.f.out.f90"
system bin/"findent #{flags} < progfree.f.in > progfree.f.out.f90"
assert_predicate testpath/"progfree.f.out.f90", :exist?
assert compare_file(testpath/"progfree.f.try.f.ref", testpath/"progfree.f.out.f90")
end
Expand Down
3 changes: 2 additions & 1 deletion Formula/f/fizmo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ def install

test do
system bin/"fizmo-console", "--help"

# Unable to test headless ncursew client
# https://github.com/Homebrew/homebrew-games/pull/366
# system "#{bin}/fizmo-ncursesw", "--help"
# system bin/"fizmo-ncursesw", "--help"
system bin/"fizmo-sdl2", "--help"
end
end
4 changes: 2 additions & 2 deletions Formula/f/flamegraph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def install
EOS

output = shell_output "#{bin}/stackcollapse-perf.pl #{testpath}/perf-mirageos-stacks-01.txt"
assert_match File.read("#{testpath}/perf-mirageos-stacks-01-collapsed-all.txt"), output
assert_match (testpath/"perf-mirageos-stacks-01-collapsed-all.txt").read, output

system "#{bin}/flamegraph.pl", "#{testpath}/perf-mirageos-stacks-01-collapsed-all.txt"
system bin/"flamegraph.pl", "#{testpath}/perf-mirageos-stacks-01-collapsed-all.txt"
end
end
17 changes: 9 additions & 8 deletions Formula/f/flann.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ class Flann < Formula
depends_on "pkg-config" => :build
depends_on "hdf5"

resource "homebrew-dataset" do
url "https://github.com/flann-lib/flann/files/6518483/dataset.zip"
sha256 "169442be3e9d8c862eb6ae4566306c31ff18406303d87b4d101f367bc5d17afa"
end

def install
system "cmake", "-S", ".", "-B", "build",
"-DBUILD_PYTHON_BINDINGS:BOOL=OFF",
Expand All @@ -37,8 +32,14 @@ def install
end

test do
resource("homebrew-dataset").stage testpath
system "#{bin}/flann_example_c"
system "#{bin}/flann_example_cpp"
resource "homebrew-dataset" do
url "https://github.com/flann-lib/flann/files/6518483/dataset.zip"
sha256 "169442be3e9d8c862eb6ae4566306c31ff18406303d87b4d101f367bc5d17afa"
end

testpath.install resource("homebrew-dataset")

system bin/"flann_example_c"
system bin/"flann_example_cpp"
end
end
3 changes: 2 additions & 1 deletion Formula/f/flow-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def install
log("Hello, world!")
}
EOS
system "#{bin}/flow", "cadence", "hello.cdc"

system bin/"flow", "cadence", "hello.cdc"
end
end
4 changes: 3 additions & 1 deletion Formula/f/fobis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module fobis_test_m
character(*), parameter :: message = "Hello FoBiS"
end module
EOS

(testpath/"test-prog.f90").write <<~EOS
program fobis_test
use iso_fortran_env, only: stdout => output_unit
Expand All @@ -52,7 +53,8 @@ module fobis_test_m
write(stdout,'(A)') message
end program
EOS
system "#{bin}/FoBiS.py", "build", "-compiler", "gnu"

system bin/"py", "build", "-compiler", "gnu"
assert_match "Hello FoBiS", shell_output(testpath/"test-prog")
end
end
2 changes: 1 addition & 1 deletion Formula/f/fon-flash-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ def install
end

test do
system "#{bin}/fon-flash"
system bin/"fon-flash"
end
end
6 changes: 3 additions & 3 deletions Formula/f/fontconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def install
font_dirs << Dir["/System/Library/Assets{,V2}/com_apple_MobileAsset_Font*"].max
end

system "autoreconf", "-iv" if build.head?
system "autoreconf", "--force", "--install", "--verbose" if build.head?
ENV["UUID_CFLAGS"] = "-I#{Formula["util-linux"].include}" if OS.linux?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
Expand All @@ -69,10 +69,10 @@ def install

def post_install
ohai "Regenerating font cache, this may take a while"
system "#{bin}/fc-cache", "-frv"
system bin/"fc-cache", "-frv"
end

test do
system "#{bin}/fc-list"
system bin/"fc-list"
end
end
3 changes: 2 additions & 1 deletion Formula/f/fpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def install
rm(Dir[bin/"*.rsj"])

# Generate a default fpc.cfg to set up unit search paths
system "#{bin}/fpcmkcfg", "-p", "-d", "basepath=#{lib}/fpc/#{version}", "-o", "#{prefix}/etc/fpc.cfg"
system bin/"fpcmkcfg", "-p", "-d", "basepath=#{lib}/fpc/#{version}", "-o", prefix/"etc/fpc.cfg"

if OS.linux?
# On Linux, non-executable IDE support files get built and end up in bin.
Expand All @@ -107,6 +107,7 @@ def install
writeln('Hello Homebrew')
end.
EOS

(testpath/"hello.pas").write(hello)
system bin/"fpc", "hello.pas"
assert_equal "Hello Homebrew", shell_output("./hello").strip
Expand Down
2 changes: 1 addition & 1 deletion Formula/f/freetds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ def install
end

test do
system "#{bin}/tsql", "-C"
system bin/"tsql", "-C"
end
end
6 changes: 4 additions & 2 deletions Formula/f/fstrm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Fstrm < Formula
depends_on "libevent"

def install
system "autoreconf", "-fvi" if build.head?
system "autoreconf", "--force", "--install", "--verbose" if build.head?
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
Expand All @@ -54,7 +54,9 @@ def install
"-u", "dnstap.sock", "-w", "capture.fstrm", "-dddd"
end
sleep 2

system bin/"fstrm_dump", "capture.fstrm"
ensure
Process.kill("TERM", job)
system "#{bin}/fstrm_dump", "capture.fstrm"
end
end
2 changes: 1 addition & 1 deletion Formula/f/fuse-emulator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ def install
end

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

# this is a lame test, but fwupdtool requires root access to do anything much interesting
system "#{bin}/fwupdtool", "-h"
system bin/"fwupdtool", "-h"
end
end
Loading

0 comments on commit b00797a

Please sign in to comment.