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.
This commit is contained in:
Max Howell 2009-09-03 20:58:33 +01:00
parent 21df479f1b
commit 18d9fbee98
2 changed files with 11 additions and 11 deletions

View File

@ -260,7 +260,7 @@ private
`strip #{args} #{path}` `strip #{args} #{path}`
else else
# strip unlinks the file and recreates it, thus breaking hard links! # 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 tmp=`mktemp -t #{path.basename}`.strip
`strip #{args} -o #{tmp} #{path}` `strip #{args} -o #{tmp} #{path}`
`cat #{tmp} > #{path}` `cat #{tmp} > #{path}`
@ -275,9 +275,9 @@ private
strip path, '-SxX' strip path, '-SxX'
when /Mach-O [^ ]* ?executable/ when /Mach-O [^ ]* ?executable/
strip path strip path
perms=0544 perms=0555
when /script text executable/ when /script text executable/
perms=0544 perms=0555
end end
path.chmod perms path.chmod perms
end end

View File

@ -42,9 +42,9 @@ def onoe error
end end
def pretty_duration s def pretty_duration s
return "#{(s*1000).to_i} milliseconds" if s < 3 return "2 seconds" if s < 3 # avoids the plural problem ;)
return "#{s.to_i} seconds" if s < 10*60 return "#{s.to_i} seconds" if s < 120
return "#{(s/60).to_i} minutes" return "%.1f minutes" % (s/60)
end end
def interactive_shell def interactive_shell