Project

General

Profile

Misc #11548 ยป bug11548.patch

willianveiga (Willian Veiga), 10/01/2015 01:17 PM

View differences:

lib/fileutils.rb
end
module_function :uptodate?
def remove_tailing_slash(dir)
def remove_trailing_slash(dir)
dir == '/' ? dir : dir.chomp(?/)
end
private_module_function :remove_tailing_slash
private_module_function :remove_trailing_slash
#
# Options: mode noop verbose
......
fu_output_message "mkdir -p #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}" if options[:verbose]
return *list if options[:noop]
list.map {|path| remove_tailing_slash(path)}.each do |path|
list.map {|path| remove_trailing_slash(path)}.each do |path|
# optimize for the most common case
begin
fu_mkdir path, options[:mode]
......
OPT_TABLE['makedirs'] = [:mode, :noop, :verbose]
def fu_mkdir(path, mode) #:nodoc:
path = remove_tailing_slash(path)
path = remove_trailing_slash(path)
if mode
Dir.mkdir path, mode
File.chmod mode, path
......
return if options[:noop]
list.each do |dir|
begin
Dir.rmdir(dir = remove_tailing_slash(dir))
Dir.rmdir(dir = remove_trailing_slash(dir))
if parents
until (parent = File.dirname(dir)) == '.' or parent == dir
dir = parent
    (1-1/1)