1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/fileutils.rb (FileUtils#chown, FileUtils#chown_R): If user

and group are both nil, print ":".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2013-07-09 07:01:59 +00:00
parent 8ce3f4beea
commit 02f61f874a
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Tue Jul 9 15:03:24 2013 Akinori MUSHA <knu@iDaemons.org>
* 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@gmail.com> Tue Jul 9 12:47:08 2013 Masaki Matsushita <glass.saga@gmail.com>
* io.c (appendline): use READ_CHAR_PENDING_XXX macros and * io.c (appendline): use READ_CHAR_PENDING_XXX macros and

View file

@ -1044,8 +1044,8 @@ module FileUtils
def chown(user, group, list, options = {}) def chown(user, group, list, options = {})
fu_check_options options, OPT_TABLE['chown'] fu_check_options options, OPT_TABLE['chown']
list = fu_list(list) list = fu_list(list)
fu_output_message sprintf('chown %s%s', fu_output_message sprintf('chown %s %s',
(group ? [user,group].join(':') : user) + ' ', (group ? "#{user}:#{group}" : user || ':'),
list.join(' ')) if options[:verbose] list.join(' ')) if options[:verbose]
return if options[:noop] return if options[:noop]
uid = fu_get_uid(user) uid = fu_get_uid(user)
@ -1073,9 +1073,9 @@ module FileUtils
def chown_R(user, group, list, options = {}) def chown_R(user, group, list, options = {})
fu_check_options options, OPT_TABLE['chown_R'] fu_check_options options, OPT_TABLE['chown_R']
list = fu_list(list) 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' : ''), (options[:force] ? 'f' : ''),
(group ? [user,group].join(':') : user) + ' ', (group ? "#{user}:#{group}" : user || ':'),
list.join(' ')) if options[:verbose] list.join(' ')) if options[:verbose]
return if options[:noop] return if options[:noop]
uid = fu_get_uid(user) uid = fu_get_uid(user)