1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Revise last change to copy-directory

* lisp/files.el (copy-directory): Instead of demoting errors
from set-file-times, refrain from setting them if newname is
located within /contents.
This commit is contained in:
Po Lu 2023-08-26 16:27:03 +08:00
parent 09351df10a
commit 91830b8bf3

View file

@ -6623,10 +6623,14 @@ into NEWNAME instead."
(follow-flag (unless follow 'nofollow)))
(if modes (set-file-modes newname modes follow-flag))
(when times
;; Don't didactically fail if file times can't be set, as
;; some file systems forbid modifying them.
(with-demoted-errors "Setting file times: %s"
(set-file-times newname times follow-flag))))))))
;; When built for an Android GUI build, don't attempt to
;; set file times for a file within /content, as the
;; Android VFS layer does not provide means to change file
;; timestamps.
(when (or (not (and (eq system-type 'android)
(featurep 'android)))
(not (string-prefix-p "/content/" newname)))
(set-file-times newname times follow-flag))))))))
;; At time of writing, only info uses this.