From 9a4567c2f971320fa63cef3b5e31638a0177aae6 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Tue, 11 Dec 2012 08:29:14 -0800 Subject: pathname.rb: Pass -s to du instead of -d0 The option `du -s` is equivalent to `du -d0`. The former is a POSIX standard (IEEE Std 1003.1-2008), whereas the latter is a BSD extension. From the BSD man page: `-s Display an entry for each specified file. (Equivalent to -d 0)` From SUSv4: `-s Instead of the default output, report only the total sum for each of the specified files.` http://pubs.opengroup.org/onlinepubs/9699919799/utilities/du.html Closes Homebrew/homebrew#16516. Signed-off-by: Charlie Sharpsteen --- Library/Homebrew/extend/pathname.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index d39b21689..ae64df0c1 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -164,7 +164,7 @@ class Pathname out='' n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i out<<"#{n} files, " if n > 1 - out<<`/usr/bin/du -hd0 #{to_s} | cut -d"\t" -f1`.strip + out<<`/usr/bin/du -hs #{to_s} | cut -d"\t" -f1`.strip end def version -- cgit v1.2.3