diff options
| author | Jack Nagel | 2012-08-19 19:33:32 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2012-08-19 19:48:13 -0500 | 
| commit | db459fe4dad0ea208a48c67e3291d75415454103 (patch) | |
| tree | 365b790c8c72d1e2dec91d84048fa39839dc9bff /Library/Formula/coreutils.rb | |
| parent | 4309233d0b8ce2d9ac8803e6188f38bd848c4c44 (diff) | |
| download | homebrew-db459fe4dad0ea208a48c67e3291d75415454103.tar.bz2 | |
coreutils: simplify mapping commands into gnubin
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/coreutils.rb')
| -rw-r--r-- | Library/Formula/coreutils.rb | 22 | 
1 files changed, 8 insertions, 14 deletions
| diff --git a/Library/Formula/coreutils.rb b/Library/Formula/coreutils.rb index 3ba748c33..9c6e8eb57 100644 --- a/Library/Formula/coreutils.rb +++ b/Library/Formula/coreutils.rb @@ -12,13 +12,9 @@ class Coreutils < Formula      system "./configure", "--prefix=#{prefix}", "--program-prefix=g"      system "make install" -    # set installed binaries -    commands = coreutils_bins - -    # create a gnubin dir that has all the commands without program-prefix -    (libexec+'gnubin').mkpath -    commands.each do |cmd| -      ln_sf "../../bin/g#{cmd}", libexec+"gnubin/#{cmd}" +    # Symlink all commands into libexec/gnubin without the 'g' prefix +    coreutils_bins.each do |cmd| +      (libexec/'gnubin').install_symlink bin/"g#{cmd}" => cmd      end    end @@ -33,13 +29,11 @@ class Coreutils < Formula    end    def coreutils_bins -    require 'find' -    bin_path = prefix+'bin' -    commands = Array.new -    Find.find(bin_path) do |path| -      next if path == bin_path or File.basename(path) == '.DS_Store' -      commands << File.basename(path).sub(/^g/,'') +    commands = [] +    bin.find do |path| +      next if path.directory? or path.basename.to_s == '.DS_Store' +      commands << path.basename.to_s.sub(/^g/,'')      end -    return commands.sort +    commands.sort    end  end | 
