rbuninstall.rb: show paths without destdir as well as rbinstall.rb

上级 e88bb6a2
......@@ -23,7 +23,6 @@
$files = []
}
list = ($_.chomp!('/') ? $dirs : $files)
$_ = File.join($destdir, $_) if $destdir
list << $_
END {
status = true
......@@ -32,6 +31,7 @@
$files.each do |file|
print "rm #{file}#{ors}"
unless $dryrun
file = File.join($destdir, file) if $destdir
begin
File.unlink(file)
rescue Errno::ENOENT
......@@ -49,13 +49,14 @@
dir = File.dirname(dir) while File.basename(dir) == '.'
print "rmdir #{dir}#{ors}"
unless $dryrun
realdir = $destdir ? File.join($destdir, dir) : dir
begin
begin
unlink.delete(dir)
Dir.rmdir(dir)
Dir.rmdir(realdir)
rescue Errno::ENOTDIR
raise unless File.symlink?(dir)
File.unlink(dir)
raise unless File.symlink?(realdir)
File.unlink(realdir)
end
rescue Errno::ENOENT, Errno::ENOTEMPTY
rescue
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册