Guillaume Demeyère <[email protected]> writes:

> Hi Michael,

Hi Guillaume,

> I re-ran the test "copy-file" with emacs -Q beginning with setting
> tramp-verbose to 6. The logs are attached.

Thanks. This is helpful, and I found the problem. Tramp tries to check
whether the local machine does support "gzip":

> 13:26:45.178653 tramp-call-process (6) # 
> `C:/Users/gde3/Documents/emacs-26.2-x86_64/libexec/emacs/26.2/x86_64-w64-mingw32/cmdproxy.exe
>  /c echo xyzzy | "env" "GZIP=" "gzip" | "env" "GZIP=" "gzip" "-d"' nil nil
> 13:26:45.300479 tramp-call-process (6) # 0
> ERROR env: CreateProcessA

The process call returns error code 0 (this is what Tramp checks), but
there is also an error string. Tramp didn't check this. That's why Tramp
has decided it could use "gzip".

It's a pity that on MS Windows one cannot trust the return code. Hmm, so
what. The appended patch shall fix it, could you pls test? Personally, I
don't run MS Windows machines.

> Cordialement,
>
> Guillaume Demeyère

Best regards, Michael.

*** /tmp/ediffixRi1a	2019-07-09 15:02:59.820181485 +0200
--- /home/albinus/src/tramp-2-3-stable/lisp/tramp-sh.el	2019-07-09 14:51:24.538904165 +0200
***************
*** 4465,4484 ****
  	   vec 5
  	   "Checking local compress commands `%s', `%s' for sanity"
  	   compress decompress)
! 	  (unless
! 	      (zerop
! 	       (tramp-call-local-coding-command
! 		(format
! 		 "echo %s | %s | %s" magic
! 		 ;; Windows shells need the program file name after
! 		 ;; the pipe symbol be quoted if they use forward
! 		 ;; slashes as directory separators.
! 		 (mapconcat
! 		  'shell-quote-argument (split-string compress) " ")
! 		 (mapconcat
! 		  'shell-quote-argument (split-string decompress) " "))
! 		nil nil))
! 	    (throw 'next nil))
  	  (tramp-message
  	   vec 5
  	   "Checking remote compress commands `%s', `%s' for sanity"
--- 4465,4487 ----
  	   vec 5
  	   "Checking local compress commands `%s', `%s' for sanity"
  	   compress decompress)
! 	  (with-temp-buffer
! 	    (unless (and
! 		     (zerop
! 		      (tramp-call-local-coding-command
! 		       (format
! 			"echo %s | %s | %s" magic
! 			;; Windows shells need the program file name
! 			;; after the pipe symbol be quoted if they use
! 			;; forward slashes as directory separators.
! 			(mapconcat
! 			 'shell-quote-argument (split-string compress) " ")
! 			(mapconcat
! 			 'shell-quote-argument (split-string decompress) " "))
! 		       nil t))
! 		     (string-match
! 		      (concat "^" (regexp-quote magic) "$") (buffer-string)))
! 	      (throw 'next nil)))
  	  (tramp-message
  	   vec 5
  	   "Checking remote compress commands `%s', `%s' for sanity"
***************
*** 4486,4491 ****
--- 4489,4498 ----
  	  (unless (tramp-send-command-and-check
  		   vec (format "echo %s | %s | %s" magic compress decompress) t)
  	    (throw 'next nil))
+ 	  (with-current-buffer (tramp-get-buffer vec)
+ 	    (goto-char (point-min))
+ 	    (unless (looking-at (regexp-quote magic))
+ 	      (throw 'next nil)))
  	  (setq found t)))

        ;; Did we find something?
_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to