ruby-changes:29799
From: knu <ko1@a...>
Date: Tue, 9 Jul 2013 16:02:12 +0900 (JST)
Subject: [ruby-changes:29799] knu:r41851 (trunk): * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user
knu 2013-07-09 16:01:59 +0900 (Tue, 09 Jul 2013) New Revision: 41851 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41851 Log: * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user and group are both nil, print ":". Modified files: trunk/ChangeLog trunk/lib/fileutils.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 41850) +++ ChangeLog (revision 41851) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jul 9 15:03:24 2013 Akinori MUSHA <knu@i...> + + * lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user + and group are both nil, print ":". + Tue Jul 9 12:47:08 2013 Masaki Matsushita <glass.saga@g...> * io.c (appendline): use READ_CHAR_PENDING_XXX macros and Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 41850) +++ lib/fileutils.rb (revision 41851) @@ -1044,8 +1044,8 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1044 def chown(user, group, list, options = {}) fu_check_options options, OPT_TABLE['chown'] list = fu_list(list) - fu_output_message sprintf('chown %s%s', - (group ? [user,group].join(':') : user) + ' ', + fu_output_message sprintf('chown %s %s', + (group ? "#{user}:#{group}" : user || ':'), list.join(' ')) if options[:verbose] return if options[:noop] uid = fu_get_uid(user) @@ -1073,9 +1073,9 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1073 def chown_R(user, group, list, options = {}) fu_check_options options, OPT_TABLE['chown_R'] list = fu_list(list) - fu_output_message sprintf('chown -R%s %s%s', + fu_output_message sprintf('chown -R%s %s %s', (options[:force] ? 'f' : ''), - (group ? [user,group].join(':') : user) + ' ', + (group ? "#{user}:#{group}" : user || ':'), list.join(' ')) if options[:verbose] return if options[:noop] uid = fu_get_uid(user) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/