diff options
| author | Max Howell | 2009-09-03 20:58:33 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-03 20:58:33 +0100 |
| commit | 18d9fbee9804f0862ed42ddd89b00e3999470c9e (patch) | |
| tree | 7c9f602bd408755acd4a12154f4fa36d43dd868d /Library | |
| parent | 21df479f1b8ff6c9497afe0c0f435fa9051966e4 (diff) | |
| download | brew-18d9fbee9804f0862ed42ddd89b00e3999470c9e.tar.bz2 | |
Closes Homebrew/homebrew#27 (permissions to strict)
I went with 0555 as the permissions changing only occurs to bin, sbin and lib, so there shouldn't be any files in there for editing in general anyway.
Formulae can specify not to "clean" any particular file by reimplementing the skip_clean? function, in case some config file or what not ends up in there.
Also committing cosmetic fix to pretty_duration function.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/brew.h.rb | 16 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index f771a3245..8b3939968 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -260,7 +260,7 @@ private `strip #{args} #{path}` else # strip unlinks the file and recreates it, thus breaking hard links! - # is this expected behaviour? patch does it too… still,mktm this fixes it + # is this expected behaviour? patch does it too… still, this fixes it tmp=`mktemp -t #{path.basename}`.strip `strip #{args} -o #{tmp} #{path}` `cat #{tmp} > #{path}` @@ -271,13 +271,13 @@ private def clean_file path perms=0444 case `file -h #{path}` - when /Mach-O dynamically linked shared library/ - strip path, '-SxX' - when /Mach-O [^ ]* ?executable/ - strip path - perms=0544 - when /script text executable/ - perms=0544 + when /Mach-O dynamically linked shared library/ + strip path, '-SxX' + when /Mach-O [^ ]* ?executable/ + strip path + perms=0555 + when /script text executable/ + perms=0555 end path.chmod perms end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 2bd05e15d..67a69dec2 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -42,9 +42,9 @@ def onoe error end def pretty_duration s - return "#{(s*1000).to_i} milliseconds" if s < 3 - return "#{s.to_i} seconds" if s < 10*60 - return "#{(s/60).to_i} minutes" + return "2 seconds" if s < 3 # avoids the plural problem ;) + return "#{s.to_i} seconds" if s < 120 + return "%.1f minutes" % (s/60) end def interactive_shell |
