Skip to content

Commit

Permalink
Merge pull request #179163 from Homebrew/m-rubocop-no-rmrf
Browse files Browse the repository at this point in the history
m*: Fix `Homebrew/NoFileutilsRmrf` RuboCop offenses
  • Loading branch information
p-linnane committed Jul 31, 2024
2 parents 464ec8f + d6eb858 commit 926618a
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Formula/m/mailcatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def install
# Remove temporary logs that reference Homebrew shims.
# TODO: See if we can handle this better:
# https://github.com/sparklemotion/sqlite3-ruby/discussions/394
rm_rf libexec/"gems/sqlite3-#{resource("sqlite").version}/ext/sqlite3/tmp"
rm_r(libexec/"gems/sqlite3-#{resource("sqlite").version}/ext/sqlite3/tmp")
end

service do
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/mako.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def install
os = OS.kernel_name.downcase
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
libexec.glob("lib/node_modules/@umijs/mako/node_modules/nice-napi/prebuilds/*")
.each { |dir| dir.rmtree if dir.basename.to_s != "#{os}-#{arch}" }
.each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }
end

test do
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/mariadb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mariadb-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mariadb-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup script into bin
bin.install_symlink prefix/"scripts/mysql_install_db"
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup script into bin
bin.install_symlink prefix/"scripts/mysql_install_db"
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup script into bin
bin.install_symlink prefix/"scripts/mysql_install_db"
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup script into bin
bin.install_symlink prefix/"scripts/mysql_install_db"
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup script into bin
bin.install_symlink prefix/"scripts/mysql_install_db"
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mysql-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mysql-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mariadb-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mariadb-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
6 changes: 3 additions & 3 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def install

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Save space
(prefix/"mariadb-test").rmtree
(prefix/"sql-bench").rmtree
rm_r(prefix/"mariadb-test")
rm_r(prefix/"sql-bench")

# Link the setup scripts into bin
bin.install_symlink [
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/maven-shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MavenShell < Formula

def install
# Remove windows files.
rm_f Dir["bin/*.bat"]
rm(Dir["bin/*.bat"])
libexec.install Dir["*"]
bin.install_symlink libexec/"bin/mvnsh"
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/maven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Maven < Formula

def install
# Remove windows files
rm_f Dir["bin/*.cmd"]
rm(Dir["bin/*.cmd"])

# Fix the permissions on the global settings file.
chmod 0644, "conf/settings.xml"
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/mbedtls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def install
system "cmake", "--install", "build"

# Why does Mbedtls ship with a "Hello World" executable. Let's remove that.
rm_f bin/"hello"
rm(bin/"hello")
# Rename benchmark & selftest, which are awfully generic names.
mv bin/"benchmark", bin/"mbedtls-benchmark"
mv bin/"selftest", bin/"mbedtls-selftest"
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def install
system "cmake", "--install", "build"

# Why does Mbedtls ship with a "Hello World" executable. Let's remove that.
rm_f bin/"hello"
rm(bin/"hello")
# Rename benchmark & selftest, which are awfully generic names.
mv bin/"benchmark", bin/"mbedtls-benchmark"
mv bin/"selftest", bin/"mbedtls-selftest"
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/metricbeat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Metricbeat < Formula

def install
# remove non open source files
rm_rf "x-pack"
rm_r("x-pack")

cd "metricbeat" do
# don't build docs because it would fail creating the combined OSS/x-pack
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/mikutter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def install
system "bundle", "install",
"--local", "--path=#{lib}/mikutter/vendor"

rm_rf "vendor"
rm_r("vendor")
(lib/"mikutter").install "plugin"
libexec.install Dir["*"]

Expand Down
2 changes: 1 addition & 1 deletion Formula/m/minetest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def install
inreplace "src/CMakeLists.txt", "fixup_bundle(", "# \\0"

# Remove bundled libraries to prevent fallback
%w[lua gmp jsoncpp].each { |lib| (buildpath/"lib"/lib).rmtree }
%w[lua gmp jsoncpp].each { |lib| rm_r(buildpath/"lib"/lib) }

(buildpath/"games/minetest_game").install resource("minetest_game")
(buildpath/"lib/irrlichtmt").install resource("irrlichtmt")
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/mold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def install
# This helps make the bottle relocatable.
inreplace "common/config.h.in", "@CMAKE_INSTALL_FULL_LIBDIR@", ""
# Ensure we're using Homebrew-provided versions of these dependencies.
%w[blake3 mimalloc tbb zlib zstd].each { |dir| (buildpath/"third-party"/dir).rmtree }
%w[blake3 mimalloc tbb zlib zstd].each { |dir| rm_r(buildpath/"third-party"/dir) }
args = %w[
-DMOLD_LTO=ON
-DMOLD_USE_MIMALLOC=ON
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/monika.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def install
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
node_modules = libexec/"lib/node_modules/@hyperjumptech/monika/node_modules"
node_modules.glob("nice-napi/prebuilds/*")
.each { |dir| dir.rmtree if dir.basename.to_s != "#{os}-#{arch}" }
.each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }

# Replace universal binaries with native slices.
deuniversalize_machos
Expand Down
2 changes: 1 addition & 1 deletion Formula/m/mupdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def install
# Remove bundled libraries excluding `extract`, `gumbo-parser` (deprecated), and
# "strongly preferred" `lcms2mt` (lcms2 fork)
keep = %w[extract gumbo-parser lcms2]
(buildpath/"thirdparty").each_child { |path| path.rmtree if keep.exclude? path.basename.to_s }
(buildpath/"thirdparty").each_child { |path| rm_r(path) if keep.exclude? path.basename.to_s }

args = %W[
build=release
Expand Down
4 changes: 2 additions & 2 deletions Formula/m/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ def install
end

# Remove the tests directory
rm_rf prefix/"mysql-test"
rm_r(prefix/"mysql-test")

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Fix up the control script and link into bin.
inreplace "#{prefix}/support-files/mysql.server",
Expand Down
4 changes: 2 additions & 2 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ def install
end

# Remove the tests directory
rm_rf prefix/"mysql-test"
rm_r(prefix/"mysql-test")

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Fix up the control script and link into bin.
inreplace "#{prefix}/support-files/mysql.server",
Expand Down
4 changes: 2 additions & 2 deletions Formula/m/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def install
end

# Remove the tests directory
rm_rf prefix/"mysql-test"
rm_r(prefix/"mysql-test")

# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
rm_r(prefix/"data")

# Fix up the control script and link into bin.
inreplace "#{prefix}/support-files/mysql.server",
Expand Down

0 comments on commit 926618a

Please sign in to comment.