Fix Tramp distrobox integration

* lisp/net/tramp.el (tramp-yesno-prompt-regexp): Fix docstring.
(tramp-yn-prompt-regexp): Fix docstring.  Extend.  Add :version.

* test/lisp/net/tramp-tests.el (tramp-test03-file-error): Adapt test.
This commit is contained in:
Michael Albinus 2026-06-04 08:34:48 +02:00
parent 108710992d
commit fe1c02d849
2 changed files with 8 additions and 3 deletions

View file

@ -801,19 +801,23 @@ The regexp should match at end of buffer."
(? "/[fingerprint]") ")?"
(* blank))
"Regular expression matching all yes/no queries which need to be confirmed.
The confirmation should be done with yes or no.
The confirmation should be done with \"yes\" or \"no\".
The regexp should match at end of buffer.
See also `tramp-yn-prompt-regexp'."
:type 'regexp)
(defcustom tramp-yn-prompt-regexp
(rx (| (: "Store key in cache? (y/n" (* nonl) ")")
"Update cached key? (y/n, Return cancels connection)")
"Update cached key? (y/n, Return cancels connection)"
;; distrobox.
(: "Error: no such container \"" (+ nonl) "\"\n"
"Create it now, out of image " (+ nonl) "? [Y/n]:"))
(* blank))
"Regular expression matching all y/n queries which need to be confirmed.
The confirmation should be done with y or n.
The confirmation should be done with \"y\" or \"n\".
The regexp should match at end of buffer.
See also `tramp-yesno-prompt-regexp'."
:version "31.1"
:type 'regexp)
;;;###tramp-autoload

View file

@ -2299,6 +2299,7 @@ being the result.")
(tramp-default-proxies-alist tramp-default-proxies-alist)
(tramp-show-ad-hoc-proxies t))
(cl-letf* (((symbol-function #'read-string) #'ignore) ; Suppress password.
((symbol-function #'y-or-n-p) #'ignore) ; distrobox.
((tramp-file-name-host vec) "example.com.invalid"))
(should-error
(file-exists-p (tramp-make-tramp-file-name vec))