diff --git a/ChangeLog b/ChangeLog index 2e703e78b7..64eac6c00a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 29 12:50:02 2014 Tanaka Akira + + * lib/fileutils.rb: Don't need to define fu_get_gid and fu_get_gid in + rescue LoadError on 'etc'. + Tue Apr 29 10:21:38 2014 Kazuki Tsujimoto * parse.y (symbols_i): like r45492, call rb_gc_resurrect(). diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 6d1f2764fa..4efc6184c2 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1097,47 +1097,35 @@ module FileUtils begin require 'etc' - - def fu_get_uid(user) #:nodoc: - return nil unless user - case user - when Integer - user - when /\A\d+\z/ - user.to_i - else - Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil - end - end - private_module_function :fu_get_uid - - def fu_get_gid(group) #:nodoc: - return nil unless group - case group - when Integer - group - when /\A\d+\z/ - group.to_i - else - Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil - end - end - private_module_function :fu_get_gid - - rescue LoadError - # need Win32 support??? - - def fu_get_uid(user) #:nodoc: - user # FIXME - end - private_module_function :fu_get_uid - - def fu_get_gid(group) #:nodoc: - group # FIXME - end - private_module_function :fu_get_gid + rescue LoadError # rescue LoadError for miniruby end + def fu_get_uid(user) #:nodoc: + return nil unless user + case user + when Integer + user + when /\A\d+\z/ + user.to_i + else + Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil + end + end + private_module_function :fu_get_uid + + def fu_get_gid(group) #:nodoc: + return nil unless group + case group + when Integer + group + when /\A\d+\z/ + group.to_i + else + Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil + end + end + private_module_function :fu_get_gid + # # Options: noop verbose #