Skip to content

Commit

Permalink
Merge pull request #178118 from Homebrew/batch-one-rubocop-fileutils-…
Browse files Browse the repository at this point in the history
…rmrf

a*: Fix `Homebrew/NoFileutilsRmrf` RuboCop offenses
  • Loading branch information
issyl0 committed Jul 31, 2024
2 parents 19e8b2a + ae154d2 commit f5e864e
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Formula/a/aarch64-elf-gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def install
system "make", "install-target-libgcc"

# FSF-related man pages may conflict with native gcc
(share/"man/man7").rmtree
rm_r(share/"man/man7")
end
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/a/agda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def install
end

# Clean up references to Homebrew shims in the standard library
rm_rf "#{agdalib}/dist-newstyle/cache"
rm_r("#{agdalib}/dist-newstyle/cache")

# generate the cubical library's documentation files
cubicallib = agdalib/"cubical"
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/allure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Allure < Formula

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

libexec.install Dir["*"]
bin.install Dir["#{libexec}/bin/*"]
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/alluxio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def install
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env("11")
chmod "+x", Dir["#{libexec}/bin/*"]

rm_rf Dir["#{etc}/alluxio/*"]
rm_r(Dir["#{etc}/alluxio/*"])

(etc/"alluxio").install libexec/"conf/alluxio-env.sh.template" => "alluxio-env.sh"
ln_sf "#{etc}/alluxio/alluxio-env.sh", "#{libexec}/conf/alluxio-env.sh"
Expand Down
4 changes: 2 additions & 2 deletions Formula/a/apache-archiva.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class ApacheArchiva < Formula

def install
libexec.install Dir["*"]
rm_f libexec.glob("bin/wrapper*")
rm_f libexec.glob("lib/libwrapper*")
rm(libexec.glob("bin/wrapper*"))
rm(libexec.glob("lib/libwrapper*"))
(bin/"archiva").write_env_script libexec/"bin/archiva", Language::Java.java_home_env

wrapper = Formula["java-service-wrapper"].opt_libexec
Expand Down
4 changes: 2 additions & 2 deletions Formula/a/apache-drill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class ApacheDrill < Formula
depends_on "openjdk@11"

def install
rm_f Dir["bin/*.bat"]
rm(Dir["bin/*.bat"])
libexec.install Dir["*"]
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("11"))
rm_f Dir["#{bin}/*.txt"]
rm(Dir["#{bin}/*.txt"])
end

test do
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/apache-geode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ApacheGeode < Formula
depends_on "openjdk@11"

def install
rm_f "bin/gfsh.bat"
rm("bin/gfsh.bat")
bash_completion.install "bin/gfsh-completion.bash" => "gfsh"
libexec.install Dir["*"]
(bin/"gfsh").write_env_script libexec/"bin/gfsh", Language::Java.java_home_env("11")
Expand Down
4 changes: 2 additions & 2 deletions Formula/a/apache-pulsar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def install
system "tar", "-xf", "distribution/server/target/#{binpfx}-bin.tar.gz"
libexec.install "#{binpfx}/bin", "#{binpfx}/lib", "#{binpfx}/instances", "#{binpfx}/conf", "#{binpfx}/trino"
libexec.glob("bin/*.cmd").map(&:unlink)
(libexec/"trino/bin/procname/Linux-aarch64").rmtree
(libexec/"trino/bin/procname/Linux-ppc64le").rmtree
rm_r(libexec/"trino/bin/procname/Linux-aarch64")
rm_r(libexec/"trino/bin/procname/Linux-ppc64le")
pkgshare.install "#{binpfx}/examples"
(etc/"pulsar").install_symlink libexec/"conf"

Expand Down
2 changes: 1 addition & 1 deletion Formula/a/apache-spark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def install
# Rename beeline to distinguish it from hive's beeline
mv "bin/beeline", "bin/spark-beeline"

rm_f Dir["bin/*.cmd"]
rm(Dir["bin/*.cmd"])
libexec.install Dir["*"]
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", JAVA_HOME: Language::Java.overridable_java_home_env("17")[:JAVA_HOME])
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/archi-steam-farm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def install
EOS

etc.install libexec/"config" => "asf"
rm_rf libexec/"config"
rm_r(libexec/"config")
libexec.install_symlink etc/"asf" => "config"
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/a/argyll-cms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def install
end

# Remove bundled libraries to prevent fallback
%w[jpeg png tiff zlib].each { |l| (buildpath/l).rmtree }
%w[jpeg png tiff zlib].each { |l| rm_r(buildpath/l) }

inreplace "Jamtop" do |s|
openssl = Formula["openssl@3"]
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/arm-none-eabi-gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def install
system "make", "install-target-libgcc"

# FSF-related man pages may conflict with native gcc
(share/"man/man7").rmtree
rm_r(share/"man/man7")
end
end

Expand Down
6 changes: 0 additions & 6 deletions Formula/a/arrayfire.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ def install
system "cmake", "--build", "build"
system "cmake", "--install", "build"

# Remove debug info. These files make patchelf fail.
rm_f [
lib/"libaf.debug",
lib/"libafcpu.debug",
lib/"libafopencl.debug",
]
pkgshare.install "examples"
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/a/asciidoctorj.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Asciidoctorj < Formula
depends_on "openjdk"

def install
rm_rf Dir["bin/*.bat"] # Remove Windows files.
rm_r(Dir["bin/*.bat"]) # Remove Windows files.
libexec.install Dir["*"]
(bin/"asciidoctorj").write_env_script libexec/"bin/asciidoctorj", JAVA_HOME: Formula["openjdk"].opt_prefix
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/atomist-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def install
bash_completion.install libexec/"lib/node_modules/@atomist/cli/assets/bash_completion/atomist"

term_size_vendor_dir = libexec/"lib/node_modules/@atomist/cli/node_modules/term-size/vendor"
term_size_vendor_dir.rmtree # remove pre-built binaries
rm_r(term_size_vendor_dir) # remove pre-built binaries

if OS.mac?
macos_dir = term_size_vendor_dir/"macos"
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/auditbeat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Auditbeat < Formula

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

cd "auditbeat" do
# don't build docs because it would fail creating the combined OSS/x-pack
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/autoconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def install
system "./configure", "--prefix=#{prefix}", "--with-lispdir=#{elisp}"
system "make", "install"

rm_f info/"standards.info"
rm(info/"standards.info")
end

test do
Expand Down
2 changes: 1 addition & 1 deletion Formula/a/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def install
system "./configure", "--prefix=#{prefix}", "--with-lispdir=#{elisp}"
system "make", "install"

rm_f info/"standards.info"
rm(info/"standards.info")
end

test do
Expand Down
4 changes: 2 additions & 2 deletions Formula/a/aws-amplify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def install
bin.install_symlink Dir["#{libexec}/bin/*"]

unless Hardware::CPU.intel?
rm_rf "#{libexec}/lib/node_modules/@aws-amplify/cli-internal/node_modules" \
"/@aws-amplify/amplify-frontend-ios/resources/amplify-xcode"
rm_r "#{libexec}/lib/node_modules/@aws-amplify/cli-internal/node_modules" \
"/@aws-amplify/amplify-frontend-ios/resources/amplify-xcode"
end

# Remove non-native libsqlite4java files
Expand Down

0 comments on commit f5e864e

Please sign in to comment.