diff options
| author | Jaeho Shin | 2012-11-05 13:35:14 -0800 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-11-11 08:32:59 -0800 |
| commit | 372c0d76849aaa18282e1841021588c74f2bf3a3 (patch) | |
| tree | 0d2bd390b8da3f276541789bdf4b8d007a2b1fbc /Library/Formula/coreutils.rb | |
| parent | bdaae65b9af7e5a00c106bdbdb07992b5ad343de (diff) | |
| download | homebrew-372c0d76849aaa18282e1841021588c74f2bf3a3.tar.bz2 | |
coreutils: Add man dir with de-prefixed names
Closes #15876.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
Diffstat (limited to 'Library/Formula/coreutils.rb')
| -rw-r--r-- | Library/Formula/coreutils.rb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Library/Formula/coreutils.rb b/Library/Formula/coreutils.rb index b65b47c42..d3fe1d862 100644 --- a/Library/Formula/coreutils.rb +++ b/Library/Formula/coreutils.rb @@ -13,9 +13,13 @@ class Coreutils < Formula system "make install" # Symlink all commands into libexec/gnubin without the 'g' prefix - coreutils_bins.each do |cmd| + coreutils_filenames(bin).each do |cmd| (libexec/'gnubin').install_symlink bin/"g#{cmd}" => cmd end + # Symlink all man(1) pages into libexec/gnuman without the 'g' prefix + coreutils_filenames(man1).each do |cmd| + (libexec/'gnuman'/'man1').install_symlink man1/"g#{cmd}" => cmd + end end def caveats; <<-EOS.undent @@ -25,15 +29,21 @@ class Coreutils < Formula can add a "gnubin" directory to your PATH from your bashrc like: PATH="$(brew --prefix coreutils)/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: + + MANPATH="$(brew --prefix coreutils)/libexec/gnuman:$MANPATH" + EOS end - def coreutils_bins - commands = [] - bin.find do |path| + def coreutils_filenames (dir) + filenames = [] + dir.find do |path| next if path.directory? or path.basename.to_s == '.DS_Store' - commands << path.basename.to_s.sub(/^g/,'') + filenames << path.basename.to_s.sub(/^g/,'') end - commands.sort + filenames.sort end end |
