From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#23952: 25.0.95; Regression: vc (git) over TRAMP doesn't work anymore Date: Tue, 12 Jul 2016 16:53:15 +0200 Message-ID: <871t2ydi1w.fsf@gmx.de> References: <87y4572z6m.fsf@secretsauce.net> <87bn23cncx.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468335398 26424 80.91.229.3 (12 Jul 2016 14:56:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Jul 2016 14:56:38 +0000 (UTC) Cc: 23952@debbugs.gnu.org, Dima Kogan To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 12 16:56:27 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bMz6n-0005h4-V5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Jul 2016 16:56:26 +0200 Original-Received: from localhost ([::1]:41045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMz6m-0001CY-WB for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Jul 2016 10:56:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMz4Y-0007P7-Ph for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2016 10:54:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMz4U-0005vW-Fd for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2016 10:54:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMz4U-0005vO-Be for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2016 10:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bMz4U-0005cB-1z for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2016 10:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jul 2016 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23952-submit@debbugs.gnu.org id=B23952.146833521021542 (code B ref 23952); Tue, 12 Jul 2016 14:54:02 +0000 Original-Received: (at 23952) by debbugs.gnu.org; 12 Jul 2016 14:53:30 +0000 Original-Received: from localhost ([127.0.0.1]:48474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMz3y-0005bO-IB for submit@debbugs.gnu.org; Tue, 12 Jul 2016 10:53:30 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:56393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMz3w-0005b9-Oz for 23952@debbugs.gnu.org; Tue, 12 Jul 2016 10:53:29 -0400 Original-Received: from detlef.gmx.de ([87.146.49.51]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Mhhr5-1bjLWn180x-00MxNO; Tue, 12 Jul 2016 16:53:18 +0200 In-Reply-To: (Andreas Schwab's message of "Tue, 12 Jul 2016 09:52:01 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:i+DI4w+bL6wT8htAIrS71ecq3Kf2rtXNN93Yxm8vGN3gKcHMS8a hEmzm+Jrt/Qi5GB2y/ubUg63NgSC+f3VQJrSqzscvhN3FC2e5ETZvRZPmskqDedNeX6x4GU 1S0qFG8yedLs0PpfqZ3UOIJydwWBg6q0CuYmPXByyPZ04cWn5QK2+GOHIGl9viyXiKQwgQB CCJS7Z4UHOHVKTBe8nYsA== X-UI-Out-Filterresults: notjunk:1;V01:K0:toVY/E/bvQA=:1xL7dDurxMsyp0CJwdXxqC QvJzFqxvFlSnKMGXCv1uvjQG/qp2MjsES8pzCkcKwFTdVTaDdt9joJjRxcO/q9NDudPEpHcxg cA9ddppJAo+omKm+R2YOb/MjhVC5xa8Vmke4n6xSdhVJjD025ZneuD6oMDf74VDZG2taDMreB FDF8D5FZ//qKFxkGEsxM/Pt4pAeCL43sfQGANAWKRgx+8dXnYi8rtEojusMpyGyK8GT5SeBJj hutanZVniKjnwGPDoFvHT0H3xhAKkT5LafzEdHBI+Wgxw2FD9rppiSj+HEbjinxXIYGP+zEzC du3ds5hQ0gdwlbLkAHPOs4fU5jAxo9U+ozg+wgzR25HNyW+seMRvFSSxtKXPA19jQl0yiz6ql MrrvPYYd12SaMMhe7NLU3wUo3Qur+Rlpx45Ql05BOHJgpnnZTLpzTC781AO3V2c042ygV+bYX fT9+dvd5mDds6iYbT3MZT9yXLArdNv7bRJ9miu7pJ/5mH9+4lldDzGa2+7rchTSw65fW2rnld SyNXQhbs1+9bXugKy3stGunVsNidOdeN1gVSNqmUt6ELKrIg0wSwM0z0zs3oBmJQj27rJaen9 Py0FLY5o2UpmdBBzs2X7scU9pFChen0a7OFfsnwHh4JwRsUs/jRPjux8CU6X5iBX35gyqL3rR ktyVmWy/bqYh6YCU0pC//SKtrt0w24v7H9RrpfG3gAc5qqHeUgeVDeRl2jB1oIPeZnUN8pubA yQ5R1GxonKVqsCCKRXPD56/jyAw4QlPkZ87958K50LLJBMv4vNS6I57rfVgMPm+u3g1wEmzs X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120913 Archived-At: Andreas Schwab writes: > env -u is a GNU extension. Indeed. The following patch should care for non-gnu remote systems: --8<---------------cut here---------------start------------->8--- *** /home/albinus/src/emacs-25/lisp/net/tramp-sh.el.~f981b3136742a8597674dd4915afeb1b220a0464~ 2016-07-12 16:47:21.714648048 +0200 --- /home/albinus/src/emacs-25/lisp/net/tramp-sh.el 2016-07-12 16:36:03.505265390 +0200 *************** *** 3027,3044 **** tramp-initial-end-of-output)) ;; We use as environment the difference to toplevel ;; `process-environment'. ! env ! (env ! (dolist ! (elt ! (cons prompt (nreverse (copy-sequence process-environment))) ! env) ! (or (member elt (default-toplevel-value 'process-environment)) ! (setq env (cons elt env))))) (command (when (stringp program) ! (format "cd %s && exec %s env %s %s" (tramp-shell-quote-argument localname) (if heredoc (format "<<'%s'" tramp-end-of-heredoc) "") (mapconcat 'tramp-shell-quote-argument env " ") (if heredoc --- 3027,3049 ---- tramp-initial-end-of-output)) ;; We use as environment the difference to toplevel ;; `process-environment'. ! env uenv ! (env (dolist (elt (cons prompt process-environment) env) ! (or (member elt (default-toplevel-value 'process-environment)) ! (if (string-match "=" elt) ! (setq env (append env `(,elt))) ! (if (tramp-get-env-with-u-option v) ! (setq env (append `("-u" ,elt) env)) ! (setq uenv (cons elt uenv))))))) (command (when (stringp program) ! (format "cd %s && %s exec %s env %s %s" (tramp-shell-quote-argument localname) + (if uenv + (format + "unset %s &&" + (mapconcat 'tramp-shell-quote-argument uenv " ")) + "") (if heredoc (format "<<'%s'" tramp-end-of-heredoc) "") (mapconcat 'tramp-shell-quote-argument env " ") (if heredoc *************** *** 3127,3146 **** (error "Implementation does not handle immediate return")) (with-parsed-tramp-file-name default-directory nil ! (let (command env input tmpinput stderr tmpstderr outbuf ret) ;; Compute command. (setq command (mapconcat 'tramp-shell-quote-argument (cons program args) " ")) ;; We use as environment the difference to toplevel `process-environment'. ! (setq env ! (dolist (elt (nreverse (copy-sequence process-environment)) env) ! (or (member elt (default-toplevel-value 'process-environment)) ! (setq env (cons elt env))))) (when env (setq command (format "env %s %s" (mapconcat 'tramp-shell-quote-argument env " ") command))) ;; Determine input. (if (null infile) (setq input "/dev/null") --- 3132,3159 ---- (error "Implementation does not handle immediate return")) (with-parsed-tramp-file-name default-directory nil ! (let (command env uenv input tmpinput stderr tmpstderr outbuf ret) ;; Compute command. (setq command (mapconcat 'tramp-shell-quote-argument (cons program args) " ")) ;; We use as environment the difference to toplevel `process-environment'. ! (dolist (elt process-environment) ! (or (member elt (default-toplevel-value 'process-environment)) ! (if (string-match "=" elt) ! (setq env (append env `(,elt))) ! (if (tramp-get-env-with-u-option v) ! (setq env (append `("-u" ,elt) env)) ! (setq uenv (cons elt uenv)))))) (when env (setq command (format "env %s %s" (mapconcat 'tramp-shell-quote-argument env " ") command))) + (when uenv + (setq command + (format + "unset %s && %s" + (mapconcat 'tramp-shell-quote-argument uenv " ") command))) ;; Determine input. (if (null infile) (setq input "/dev/null") *************** *** 5695,5700 **** --- 5708,5720 ---- ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN") (t res))))) + (defun tramp-get-env-with-u-option (vec) + (with-tramp-connection-property vec "env-u-option" + (tramp-message vec 5 "Checking, whether `env -u' works") + ;; Option "-u" is a GNU extension. + (tramp-send-command-and-check + vec "env FOO=foo env -u FOO 2>/dev/null | grep -qv FOO" t))) + ;; Some predefined connection properties. (defun tramp-get-inline-compress (vec prop size) "Return the compress command related to PROP. --8<---------------cut here---------------end--------------->8--- Should this still go to the emacs-25 branch? > Andreas. Best regards, Michael.