2013-09-15 Glenn Morris <rgm@gnu.org>
+ * eshell/em-unix.el (eshell/rm):
+ Make -f ignore missing files. (Bug#15373)
+
* eshell/esh-cmd.el (eshell--local-vars): New variable. (Bug#15372)
(eshell-rewrite-for-command): Add for loop vars to eshell--local-vars.
* eshell/esh-var.el (eshell-get-variable): Respect eshell--local-vars.
entry)))))
(eshell-funcalln 'unintern entry)))
((stringp entry)
- (if (and (file-directory-p entry)
- (not (file-symlink-p entry)))
- (if (or em-recursive
- eshell-rm-removes-directories)
- (if (or em-preview
- (not em-interactive)
- (y-or-n-p
- (format "rm: descend into directory `%s'? "
- entry)))
+ ;; -f should silently ignore missing files (bug#15373).
+ (unless (and force-removal
+ (not (file-exists-p entry)))
+ (if (and (file-directory-p entry)
+ (not (file-symlink-p entry)))
+ (if (or em-recursive
+ eshell-rm-removes-directories)
+ (if (or em-preview
+ (not em-interactive)
+ (y-or-n-p
+ (format "rm: descend into directory `%s'? "
+ entry)))
(eshell-remove-entries nil (list entry) t))
- (eshell-error (format "rm: %s: is a directory\n" entry)))
- (eshell-remove-entries nil (list entry) t)))))
+ (eshell-error (format "rm: %s: is a directory\n" entry)))
+ (eshell-remove-entries nil (list entry) t))))))
(setq args (cdr args)))
nil))