diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-28 09:23:03 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-28 09:23:03 +0000 |
commit | a21146a57503dcda22c6764afe6f67e9be5468ac (patch) | |
tree | 8423bddfe90ed6dedaea1d264bee0401f603fc7f /win32/rmdirs.bat | |
parent | 3658470310fb6095f27ef85226c7a8589e66be1e (diff) |
merges r21764 and r21765 from trunk into ruby_1_9_1.
* Makefile.in, win32/Makefile.sub (RMDIRS): remove directory and
parents.
* Makefile.in, win32/Makefile.sub (distclean-rdoc): added to remove
temprary rdoc.
* Makefile.in, win32/Makefile.sub (distclean): removes extout
directory.
* Makefile.in, win32/Makefile.sub (clean-ext): skips non-existent
directories.
* common.mk (clean, distclean): cleans rdoc.
* common.mk (clean-extout): removes extout directory.
* configure.in (RMDIRS, RMALL): added to clean extout.
* lib/fileutils.rb (FileUtils#rmdir): added :parents option.
* lib/mkmf.rb (create_makefile): cleans installed files at clean
instead of distclean.
* lib/mkmf.rb (create_makefile): added clean-so and clean-rb.
* lib/mkmf.rb (def init_mkmf): added DISTCLEANDIRS.
* lib/un.rb (rmdir): added -p option.
* tool/rmdirs, win32/rmdirs.bat: removes directory and the parents.
* win32/rm.bat: added -r option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/rmdirs.bat')
-rwxr-xr-x | win32/rmdirs.bat | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/win32/rmdirs.bat b/win32/rmdirs.bat new file mode 100755 index 0000000000..a8549cc125 --- /dev/null +++ b/win32/rmdirs.bat @@ -0,0 +1,29 @@ +::-*- batch -*-
+@echo off
+if "%1" == "-p" shift
+:begin
+if "%1" == "" goto :end
+ set dir=%1
+ shift
+ set dir=%dir:/=\%
+ :rmdirs
+ if not exist "%dir%\." goto :begin
+ if "%dir%" == "." goto :begin
+ if "%dir%" == ".." goto :begin
+ rd "%dir%" || goto :begin
+ :trim_sep
+ if not /%dir:~-1%/ == /\/ goto :trim_base
+ set dir=%dir:~0,-1%
+ if not "%dir%" == "" goto :trim_sep
+ :trim_base
+ if /%dir:~-1%/ == /\/ goto :parent
+ set dir=%dir:~0,-1%
+ if not "%dir%" == "" goto :trim_base
+ :parent
+ set dir=%dir:~0,-1%
+ if "%dir%" == "" goto :begin
+ if "%dir:~-1%" == ":" goto :begin
+ goto :rmdirs
+shift
+goto :begin
+:end
|