From e5fbc9c92ee103d4fbff80d8e77d46fde2497502 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 26 Mar 2014 13:45:46 -0500 Subject: Fall back to Process.gid if we aren't a member of the file's group --- Library/Homebrew/extend/pathname.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index cb76c8910..c9c233144 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -110,8 +110,11 @@ class Pathname FileUtils.mv tf.path, self + uid = Process.uid + gid = Process.groups.delete(old_stat.gid) { Process.gid } + begin - chown(old_stat.uid, old_stat.gid) + chown(uid, gid) chmod(old_stat.mode) rescue Errno::EPERM end -- cgit v1.2.3