Hello, everyone.

( I post to this mailing list again after an interval of 15 years. :-) )

The touch command included in busybox (version 1.30.1-6) on OpenWrt does not 
have the option "-h".
Therefore, the tramp-sh-handle-set-file-times function does not work properly 
if the argument flag is nofollow.

Could you please add the connection-property "touch-h" to fix the problem?
(I attach a sample patch based on TRAMP 22.1 for Emacs 30.1.)
--- tramp-sh.el.orig	2025-02-19 03:31:36.000000000 +0900
+++ tramp-sh.el	2025-08-12 23:35:03.827791100 +0900
@@ -1594,7 +1594,10 @@ (defun tramp-sh-handle-set-file-times (f
 	       "-t %s"
 	       (format-time-string "%Y%m%d%H%M.%S" (tramp-defined-time time) t))
 	    "")
-	  (if (eq flag 'nofollow) "-h" "")
+	  (if (and (eq flag 'nofollow)
+		   (tramp-get-connection-property v "touch-h"))
+	      "-h"
+	    "")
 	  (tramp-shell-quote-argument localname))))))
 
 (defun tramp-sh-handle-get-home-directory (vec &optional user)
@@ -5833,6 +5836,14 @@ (defun tramp-get-remote-touch (vec)
 	   result
 	   (format-time-string "%Y%m%d%H%M.%S")
 	   (tramp-file-local-name tmpfile))))
+	(tramp-set-connection-property
+	 vec "touch-h"
+	 (tramp-send-command-and-check
+	  vec
+	  (format
+	   "%s -h %s"
+	   result
+	   (tramp-file-local-name tmpfile))))
 	(delete-file tmpfile))
       result)))
 

Reply via email to