diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-28 22:03:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-28 22:03:00 +0000 |
commit | e3503ee218d8b6ca4dfa95414fe5d83b52104476 (patch) | |
tree | 05180b77547bd6e0ed149e75fa88cfb2c3e7a456 /lib/un.rb | |
parent | f29d43a3ec7b687f060037ce25522f166fc994d7 (diff) |
Octal mode in un.rb
* lib/fileutils.rb (FileUtils#symbolic_modes_to_i): revert r55524.
* lib/un.rb (install, chmod): support octal mode string. fix up
r55513.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/un.rb')
-rw-r--r-- | lib/un.rb | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -196,7 +196,7 @@ end def install setup("pm:o:g:") do |argv, options| - (mode = options.delete :m) and options[:mode] = mode + (mode = options.delete :m) and options[:mode] = /\A\d/ =~ mode ? mode.oct : mode options[:preserve] = true if options.delete :p (owner = options.delete :o) and options[:owner] = owner (group = options.delete :g) and options[:group] = group @@ -216,7 +216,8 @@ end def chmod setup do |argv, options| - mode = argv.shift.oct + mode = argv.shift + mode = /\A\d/ =~ mode ? mode.oct : mode FileUtils.chmod mode, argv, options end end |