A nil value for either argument stands for the current time."
(equal (or t1 (current-time)) (or t2 (current-time)))))
+;; `flatten-tree' has appeared in Emacs 27.1.
(if (fboundp 'flatten-tree)
(defalias 'tramp-compat-flatten-tree 'flatten-tree)
(defun tramp-compat-flatten-tree (tree)
(string-match-p "Monitoring not supported\\|No locations given" string)
(delete-process proc))
+ ;; Delete empty lines.
+ (setq string (replace-regexp-in-string "\n\n" "\n" string))
+
(while (string-match
(eval-when-compile
(concat "^[^:]+:"
"[[:space:]]\\([^:]+\\):"
- "[[:space:]]" (regexp-opt tramp-gio-events t)
+ "[[:space:]]" (regexp-opt tramp-gio-events t)
"\\([[:space:]]\\([^:]+\\)\\)?$"))
string)
(tramp-message proc 6 "%S\n%s" proc string)
(dolist (line (split-string string "[\n\r]+" 'omit))
;; Check, whether there is a problem.
- (unless (string-match-p
+ (unless (string-match
(eval-when-compile
(concat "^[^[:blank:]]+"
"[[:blank:]]+\\([^[:blank:]]+\\)+"
(setq result (buffer-substring (point) (point-at-eol)))))
result)))
+;; On hydra.nixos.org, the $PATH environment variable is too long to
+;; send it. This is likely not due to PATH_MAX, but PIPE_BUF. We
+;; check it, and use a temporary file in case of. See Bug#33781.
(defun tramp-set-remote-path (vec)
"Sets the remote environment PATH to existing directories.
I.e., for each directory in `tramp-remote-path', it is tested
(let ((command
(format "PATH=%s; export PATH"
(mapconcat 'identity (tramp-get-remote-path vec) ":")))
- (path-max
- (with-tramp-connection-property vec "path-max"
- (tramp-send-command-and-read vec "getconf PATH_MAX /")))
+ (pipe-buf
+ (with-tramp-connection-property vec "pipe-buf"
+ (tramp-send-command-and-read vec "getconf PIPE_BUF /")))
tmpfile)
(tramp-message vec 5 "Setting $PATH environment variable")
- (if (< (length command) path-max)
+ (if (< (length command) pipe-buf)
(tramp-send-command vec command)
;; Use a temporary file.
(setq tmpfile (tramp-make-tramp-temp-file vec))
;; gets confused about the file locking status. Try to find out why
;; the workaround doesn't work.
;;
-;; * Allow out-of-band methods as _last_ multi-hop. Open a connection
-;; until the last but one hop via `start-file-process'. Apply it
-;; also for ftp and smb.
-;;
;; * WIBNI if we had a command "trampclient"? If I was editing in
;; some shell with root privileges, it would be nice if I could
;; just call
;; remote host, set this environment variable to "/dev/null" or
;; whatever is appropriate on your system.
+;; For the remote file-notify library, Tramp checks for the existence
+;; of a respective command. The first command found is used. In
+;; order to use a dedicated one, the environment variable
+;; $REMOTE_FILE_NOTIFY_LIBRARY shall be set, possible values are
+;; "inotifywait", "gio-monitor" and "gvfs-monitor-dir".
+
+;; Local file-notify libraries are auto-detected during Emacs
+;; configuration. This can be changed with a respective configuration
+;; argument, like
+;;
+;; --with-file-notification=inotify
+;; --with-file-notification=kqueue
+;; --with-file-notification=gfile
+;; --with-file-notification=w32
+
;; A whole test run can be performed calling the command `file-notify-test-all'.
;;; Code:
(format "/mock::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
+;; Filter suppressed remote file-notify libraries.
+(when (stringp (getenv "REMOTE_FILE_NOTIFY_LIBRARY"))
+ (dolist (lib '("inotifywait" "gio-monitor" "gvfs-monitor-dir"))
+ (unless (string-equal (getenv "REMOTE_FILE_NOTIFY_LIBRARY") lib)
+ (add-to-list 'tramp-connection-properties `(nil ,lib nil)))))
+
(defvar file-notify--test-tmpdir nil)
(defvar file-notify--test-tmpfile nil)
(defvar file-notify--test-tmpfile1 nil)
(skip-unless (not ,skip))
(let* ((temporary-file-directory
file-notify-test-remote-temporary-file-directory)
- (ert-test (ert-get-test ',test)))
+ (ert-test (ert-get-test ',test))
+ vc-handled-backends)
(skip-unless (file-notify--test-remote-enabled))
(tramp-cleanup-connection
(tramp-dissect-file-name temporary-file-directory) nil 'keep-password)
(file-notify--test-cleanup)))
(file-notify--deftest-remote file-notify-test08-backup
- "Check that backup keeps file notification for remote files."
- (if (getenv "EMACS_HYDRA_CI") :failed :passed)) ; fixme bug#33735
+ "Check that backup keeps file notification for remote files.")
(ert-deftest file-notify-test09-watched-file-in-watched-dir ()
"Watches a directory and a file in that directory separately.