Pass arrays to inreplace instead of looping

This commit is contained in:
Jack Nagel 2014-09-29 14:42:12 -05:00
parent a18e4869e8
commit a4d401c9f0
4 changed files with 8 additions and 14 deletions

View file

@ -15,10 +15,7 @@ class ClozureCl < Formula
libexec.install Dir["*"]
scripts = Dir["#{libexec}/scripts/ccl{,64}"]
inreplace scripts do |s|
s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/, %Q{CCL_DEFAULT_DIRECTORY="#{libexec}"}
end
inreplace scripts, /CCL_DEFAULT_DIRECTORY=.+$/, %Q{CCL_DEFAULT_DIRECTORY="#{libexec}"}
bin.install_symlink scripts
end

View file

@ -24,10 +24,8 @@ class Fits < Formula
# fits-env.sh is a helper script that sets up environment
# variables, so we want to tuck this away in libexec
libexec.install 'fits-env.sh'
%w[fits.sh fits-ngserver.sh].each do |file|
inreplace file, '"$(dirname $BASH_SOURCE)/fits-env.sh"',
"'#{libexec}/fits-env.sh'"
end
inreplace %w[fits.sh fits-ngserver.sh],
'"$(dirname $BASH_SOURCE)/fits-env.sh"', "'#{libexec}/fits-env.sh'"
bin.install 'fits.sh' => 'fits'
bin.install 'fits-ngserver.sh' => 'fits-ngserver'

View file

@ -22,10 +22,8 @@ class LibunwindHeaders < Formula
inreplace "include/libunwind.h", /__OSX_AVAILABLE_STARTING\(__MAC_NA,.*\)/,
"__attribute__((unavailable))"
%w[include/libunwind.h include/unwind.h src/AddressSpace.hpp
src/InternalMacros.h].each do |header|
inreplace header, "Availability.h", "AvailabilityMacros.h"
end
inreplace %w[include/libunwind.h include/unwind.h src/AddressSpace.hpp src/InternalMacros.h],
"Availability.h", "AvailabilityMacros.h"
end
include.install Dir['include/*']

View file

@ -36,12 +36,13 @@ class ShrewsoftVpnClient < Formula
# there is no suport for an alternate Applications folder, must change hard-coded paths
if build.with? "gui"
%w{
files = %w{
package/macosx/vpn-client-install.packproj
source/qikea/CMakeLists.txt
source/qikea/root.cpp
source/qikec/CMakeLists.txt
}.each { |path| inreplace path, "/Applications", prefix }
}
inreplace files, "/Applications", prefix
end
cmake_args = std_cmake_args + [