gnu-sed: remove default-names option

This commit is contained in:
FX Coudert 2019-01-05 11:24:06 +01:00
parent 43f2e19d93
commit 068955e8cd

View file

@ -12,48 +12,42 @@ class GnuSed < Formula
sha256 "5c090deefc2dd3769191d97378b981b2dfdd64f1e0259de22682d434ad07e427" => :sierra
end
option "with-default-names", "Do not prepend 'g' to the binary"
deprecated_option "default-names" => "with-default-names"
conflicts_with "ssed", :because => "both install share/info/sed.info"
def install
args = ["--prefix=#{prefix}", "--disable-dependency-tracking"]
args << "--program-prefix=g" if build.without? "default-names"
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--program-prefix=g
]
system "./configure", *args
system "make", "install"
if build.without? "default-names"
(libexec/"gnubin").install_symlink bin/"gsed" =>"sed"
(libexec/"gnuman/man1").install_symlink man1/"gsed.1" => "sed.1"
end
(libexec/"gnubin").install_symlink bin/"gsed" =>"sed"
(libexec/"gnuman/man1").install_symlink man1/"gsed.1" => "sed.1"
end
def caveats
if build.without? "default-names" then <<~EOS
The command has been installed with the prefix "g".
If you do not want the prefix, install using the "with-default-names" option.
def caveats; <<~EOS
GNU "sed" has been installed as "gsed".
If you need to use it as "sed", you can add a "gnubin" directory
to your PATH from your bashrc like:
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
PATH="#{opt_libexec}/gnubin:$PATH"
Additionally, you can access their man pages with normal names if you add
the "gnuman" directory to your MANPATH from your bashrc as well:
Additionally, you can access its man page with normal name if you add
the "gnuman" directory to your MANPATH from your bashrc as well:
MANPATH="#{opt_libexec}/gnuman:$MANPATH"
EOS
end
EOS
end
test do
(testpath/"test.txt").write "Hello world!"
if build.with? "default-names"
system "#{bin}/sed", "-i", "s/world/World/g", "test.txt"
else
system "#{bin}/gsed", "-i", "s/world/World/g", "test.txt"
end
system "#{bin}/gsed", "-i", "s/world/World/g", "test.txt"
assert_match /Hello World!/, File.read("test.txt")
system "#{opt_libexec}/gnubin/sed", "-i", "s/world/World/g", "test.txt"
assert_match /Hello World!/, File.read("test.txt")
end
end