aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/coreutils.rb
diff options
context:
space:
mode:
authorJaeho Shin2012-01-27 11:38:16 -0800
committerAdam Vandenberg2012-01-27 20:47:13 -0800
commitc53e35ed6560fe2074c0a5e9ca2ddbec11a7d155 (patch)
tree2f8f3064353cee4d4f147c685caca66fe02c4530 /Library/Formula/coreutils.rb
parentcb327826b20446291f6f829dae978fc69adbe540 (diff)
downloadhomebrew-c53e35ed6560fe2074c0a5e9ca2ddbec11a7d155.tar.bz2
coreutils 8.15
Also add unprefixed symlinks in libexec/gnubin: - libexec/gnubin directory contains symlinks to all the coreutils commands without its program-prefix "g". (Inspired by MacPorts' coreutils) - Now without the --default-names option, this directory is essential to those who have a lot of shell scripts that use GNU coreutils with their default names. (The aliases file is no use for them) Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/coreutils.rb')
-rw-r--r--Library/Formula/coreutils.rb44
1 files changed, 15 insertions, 29 deletions
diff --git a/Library/Formula/coreutils.rb b/Library/Formula/coreutils.rb
index 48983e22f..30493319f 100644
--- a/Library/Formula/coreutils.rb
+++ b/Library/Formula/coreutils.rb
@@ -1,9 +1,6 @@
require 'formula'
-def coreutils_aliases
- s = "brew_prefix=`brew --prefix`\n"
-
- %w{
+$commands = %w{
base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit
cut date dd df dir dircolors dirname du echo env expand expr factor false
fmt fold groups head hostid id install join kill link ln logname ls md5sum
@@ -12,43 +9,32 @@ def coreutils_aliases
sha256sum sha384sum sha512sum shred shuf sleep sort split stat stty sum
sync tac tail tee test touch tr true tsort tty uname unexpand uniq unlink
uptime users vdir wc who whoami yes
- }.each do |g|
- s += "alias #{g}=\"$brew_prefix/bin/g#{g}\"\n"
- end
-
- s += "alias '['=\"$brew_prefix/bin/g\\[\"\n"
-
- return s
-end
+ }
class Coreutils < Formula
homepage 'http://www.gnu.org/software/coreutils'
- url 'http://ftpmirror.gnu.org/coreutils/coreutils-8.14.tar.xz'
- mirror 'http://ftp.gnu.org/gnu/coreutils/coreutils-8.14.tar.xz'
- sha256 '0d120817c19292edb19e92ae6b8eac9020e03d51e0af9cb116cf82b65d18b02d'
+ url 'http://ftpmirror.gnu.org/coreutils/coreutils-8.15.tar.xz'
+ mirror 'http://ftp.gnu.org/gnu/coreutils/coreutils-8.15.tar.xz'
+ sha256 '837eb377414eae463fee17d0f77e6d76bed79b87bc97ef0c23887710107fd49c'
def install
system "./configure", "--prefix=#{prefix}", "--program-prefix=g"
system "make install"
- (prefix+'aliases').write(coreutils_aliases)
+ # create a gnubin dir that has all the commands without program-prefix
+ mkdir_p libexec+'gnubin'
+ $commands.each do |g|
+ ln_sf "../../bin/g#{g}", libexec+"gnubin/#{g}"
+ end
end
- def caveats
- <<-EOS
-All commands have been installed with the prefix 'g'.
-
-A file that aliases these commands to their normal names is available
-and may be used in your bashrc like:
-
- source #{prefix}/aliases
+ def caveats; <<-EOS.undent
+ All commands have been installed with the prefix 'g'.
-But note that sourcing these aliases will cause them to be used instead
-of Bash built-in commands, which may cause problems in shell scripts.
-The Bash "printf" built-in behaves differently than gprintf, for instance,
-which is known to cause problems with "bash-completion".
+ If you really need to use these commands with their normal names, you
+ can add a "gnubin" directory to your PATH from your bashrc like:
-The man pages are still referenced with the g-prefix.
+ PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
EOS
end
end