aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cleaner.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-07-04 16:10:24 +0100
committerGitHub2016-07-04 16:10:24 +0100
commitfe29cc2920b456df3b008686d38cd8f0352c5d30 (patch)
tree73e476242f9a9f2d4c79257b8183548222c80d05 /Library/Homebrew/cleaner.rb
parent883b201c0906ad2942ec900290568836b5ddc240 (diff)
downloadbrew-fe29cc2920b456df3b008686d38cd8f0352c5d30.tar.bz2
cleaner: port to generic OS. (#447)
Diffstat (limited to 'Library/Homebrew/cleaner.rb')
-rw-r--r--Library/Homebrew/cleaner.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb
index d96caeb09..6181d3da4 100644
--- a/Library/Homebrew/cleaner.rb
+++ b/Library/Homebrew/cleaner.rb
@@ -66,6 +66,10 @@ class Cleaner
end
end
+ def executable_path?(path)
+ path.text_executable?
+ end
+
# Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
# permissions and removing .la files, unless the files (or parent
# directories) are protected by skip_clean.
@@ -87,7 +91,7 @@ class Cleaner
path.unlink
else
# Set permissions for executables and non-executables
- perms = if path.mach_o_executable? || path.text_executable?
+ perms = if executable_path?(path)
0555
else
0444
@@ -103,3 +107,5 @@ class Cleaner
end
end
end
+
+require "extend/os/cleaner"