From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 12 15:10:24 2024 Received: (at submit) by debbugs.gnu.org; 12 Feb 2024 20:10:24 +0000 Received: from localhost ([127.0.0.1]:55090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZcdD-0002AD-8u for submit@debbugs.gnu.org; Mon, 12 Feb 2024 15:10:23 -0500 Received: from lists.gnu.org ([2001:470:142::17]:42554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZccH-00024v-Fr for submit@debbugs.gnu.org; Mon, 12 Feb 2024 15:09:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZcbv-0005Vi-48 for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 15:09:03 -0500 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZcbt-00058o-0x for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 15:09:02 -0500 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-785d93d3f08so74618285a.2 for ; Mon, 12 Feb 2024 12:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1707768537; x=1708373337; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=wv4z9SomWfD1rceZfE88K+H4dypf3KU3/ly23WGafsg=; b=sLNuSG19cRNzYvHZCO2HdmsRtwF2uUH3Qm2dx3z/ip4nP6dBQz+Q9Y6LiTs8LV7GpZ yfoh1ZQ4vo8YHNh2tWFgAHxZfFLb7mcF6+lB/8Wg1EvC+hAt7SZ70xlJ7q1LzQ4DBSAv Wi2c4/ScfF7Yckg5OKCatHGxT9QbrEh5PJM0Xg2pl9wkXWFt6vU1v0v74LNxs3nAWsBP xNZ7Zcs3dVI8xiWyjJSk7gP/dtzNn6R6i6Zfv6q+KQwM2l58OM3zOpiwuSo14RSGk3YK 43+2Xk5dgLkLYNG73QbKYf6XrodJtBzWFWwpdqrANXOy6SVttaHeER+dOyrLVQXMhYIu yGpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707768537; x=1708373337; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wv4z9SomWfD1rceZfE88K+H4dypf3KU3/ly23WGafsg=; b=kcQZ74wUQ89sL7M799sD72feObbiM/BYp7fMlk7C6LWfhsDj/O7593kBrIVv87Kqay 7STcacfc2hADdpICPr4OzQpWCzwDIAJZSCpLbHIZ4G+R7JVKobDr2DnISfw5qfTOqdoU MRIxoTjzMNcutaIbb5n+VENKAX06Z94yik6yz4K4pWeMTisYWotzfol7c9fp0gK7h4Tw eYk424TD8m3kbRdia08wWu/gOoOhnixWMtVOw1u9A7OSRa1+7+VZjaW113X1o5uigDwl lW9HFmoKBMmwLEBosP7yRbUC1tdkGkn2+p5VCI4QbBo5A6s9Lak9D7XwiBmyqLeHa+2W ZRog== X-Gm-Message-State: AOJu0YxNejrHxpEc3a+C+CLfGL3RPjZTvX53yTMy/AAV0jZ7t34YarG0 11FfgChG8F1oiH+AAo5Mys85E7fBtdjaI5xB0R9PA1Bk5hdBEmNjGRG6hFoGPN0BpRnXTeQkLu9 O X-Google-Smtp-Source: AGHT+IGH6EfaML/kxhFtBmVCc0YftRyLj7VW+i3bnsq2SPaFn0Gh0iLElPrCCEVbL4m1uV4c4tPiyQ== X-Received: by 2002:a05:620a:4711:b0:786:33c1:1419 with SMTP id bs17-20020a05620a471100b0078633c11419mr2255071qkb.59.1707768537552; Mon, 12 Feb 2024 12:08:57 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id c19-20020a05620a135300b00786fe3db661sm471866qkl.31.2024.02.12.12.08.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2024 12:08:57 -0800 (PST) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods Message-Id: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> Date: Mon, 12 Feb 2024 15:08:46 -0500 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3774.500.141) Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=spd@toadstyle.org; helo=mail-qk1-x733.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi folks, This is a feature request. Tramp lets you define a method for out-of-band file copying with the tramp-methods keys tramp-copy-program, tramp-copy-args, and so on. Currently, there is no way to customize the format of remote file paths. The function tramp-make-copy-program-file-name is responsible for this job, and it is hard-coded to format files as USER@HOST:FILE. I was working on a custom Tramp method, and I ran into problems setting up OOB copying due to this limitation. It would be great if there were a key you could set in tramp-methods to override this logic. For example, maybe something like: (tramp-copy-format-file-name my-tramp-make-copy-program-file-name) Where my-tramp-make-copy-program-file-name is a function taking a vector as input and returning a string of the formatted file name (similar to tramp-make-copy-program-file-name). Alternately, maybe a format string (or something similar to tramp-login-args/tramp-copy-args) would be sufficient. In my case, I just need to add a constant prefix to the remote file name, so a format string would be fine. Thanks! In GNU Emacs 29.2 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2024-01-18 built on armbob.lan Windowing system distributor 'Apple' System Description: macOS 14 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no' Configured features: ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 37536 8456) (symbols 48 5045 0) (strings 32 13121 2410) (string-bytes 1 398579) (vectors 16 10368) (vector-slots 8 162386 14885) (floats 8 21 23) (intervals 56 217 0) (buffers 984 10)) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 12 15:20:39 2024 Received: (at 69085) by debbugs.gnu.org; 12 Feb 2024 20:20:39 +0000 Received: from localhost ([127.0.0.1]:55837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZcn8-0002z6-R2 for submit@debbugs.gnu.org; Mon, 12 Feb 2024 15:20:39 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:56486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZcn6-0002yO-Tl for 69085@debbugs.gnu.org; Mon, 12 Feb 2024 15:20:38 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d8ef977f1eso26193695ad.0 for <69085@debbugs.gnu.org>; Mon, 12 Feb 2024 12:20:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1707769213; x=1708374013; darn=debbugs.gnu.org; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=URzvDFrvrPdhSd6QNHAmWLI8HRfsUf/Nw94gx+NOPqk=; b=jrJdCO6hn6tuWgqHtV1MrAoReS7kT4mJxrIW6N8uRsSuQxv923kOKDrGxHBORc7gCU 9z2CAaTKrMKobdX1YxE66LhutGkDDvp15tpAr+SiD0cQ9UXC7fvMBvHHF+Qsb+EKHcZ9 I3AEPZvbwbYnl5U0oEGlHxoYsXDjuYuFIk4ErqTSCPW0g9jaiX6dfRliqXXmIqaO8zG8 G5QQ3XUVSXF0jgOjjFxcNLhkYwloidcmdbyKYoIyHeSjnSbeR+skEbBZlFfSmeeVs5M3 UAJFcgFaExKijWyVxPzkVvQbXutWIZMRAtXb9niv7gxtAHebyZv+7Fveb/fTVinUrhtM HBhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707769213; x=1708374013; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=URzvDFrvrPdhSd6QNHAmWLI8HRfsUf/Nw94gx+NOPqk=; b=LpuAFLMNnnKZEK+MxTYeITsbJXqQlZAuWIAUiVe2Y/aOasn/dADRGcgTvxy4Qfs2fm 1090TZQcGXZpG+U0fy79fi5OCKhnN7YSKQZVjNmlY/RHINjRU8FWfcA84RnSxJLO8VQo AvVgN+P26F79UK2m0cHynDK0eaoXXOaCfh4fFo3+tzaJrMnBrXIsYtm2Ax7DBgUXJx79 7NMIiRBSLSUWFx2ydjxOcvAGXldefEIPda0wvMyJQs8dsu54SbMk9acyrPRjknIaqt+x 8BTcnaJppNIPoPoeErZVoUgbhZKfdS3IOsNNzBA+YNcDNKFphive7FSYPVXtv9zEAlvk kxeA== X-Gm-Message-State: AOJu0YyCtH/Rzv7y41F5ugf3hDrqT50A4vep73ZZr7DHRKCYc6gWp+Ml AXm2Vv0fzFtpMYY+I94NeaceTx+ijpoy1bEy9it4IjSGMyBfrYFxjdGx7FsceGxIBRZQdMSNBWx Z X-Google-Smtp-Source: AGHT+IGGFFB2nhMYkiqIi6UdOBFQbnKAbfv897m434ZgxfF5B/dUS51R6xTqTB+wHABSFZPxa5WTzQ== X-Received: by 2002:a1f:ea82:0:b0:4c0:3116:e909 with SMTP id i124-20020a1fea82000000b004c03116e909mr3959352vkh.7.1707768887092; Mon, 12 Feb 2024 12:14:47 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id pf15-20020a056214498f00b006819bb31533sm505532qvb.99.2024.02.12.12.14.46 for <69085@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2024 12:14:46 -0800 (PST) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: Acknowledgement (29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods) Date: Mon, 12 Feb 2024 15:14:36 -0500 References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> To: 69085@debbugs.gnu.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69085 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I was able to work around the issue by advising = tramp-make-copy-program-file-name: (defun tramp-mymethod-make-copy-program-file-name (vec) (when (tramp-mymethod-file-name-p vec) (let ((localname (directory-file-name (tramp-file-name-unquote-localname = vec)))) (format "myprefix:%s" localname)))) (advice-add 'tramp-make-copy-program-file-name :before-until #'tramp-mymethod-make-copy-program-file-name) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 12 16:15:12 2024 Received: (at 69085) by debbugs.gnu.org; 12 Feb 2024 21:15:12 +0000 Received: from localhost ([127.0.0.1]:59708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZddv-0007Dk-Ox for submit@debbugs.gnu.org; Mon, 12 Feb 2024 16:15:12 -0500 Received: from mout.gmx.net ([212.227.17.22]:38581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZdds-0007Cu-W7 for 69085@debbugs.gnu.org; Mon, 12 Feb 2024 16:15:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707772484; x=1708377284; i=michael.albinus@gmx.de; bh=O6MxxXYxhFBYjZC5V+1giU39ndL9oketci9b1eMp+C8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=Y5pYZNWc0dQ9nxfQI8eASvn15c8a4f7HDAj07cpR4n1cSJKJXI6MqzCalOC5ztCU Jigm1KHGJ4u2h/Gza0VoWFwAr96UDPf/YiR8d0Jm1wSN8hDnJUe0eSaW9NpnI2hhH pvyWtRTZkRWLAjNCBOPzS+cZkB0GkOucMbX58ftFWas+CvZ/77HlzR79oZwl1e85j k6X5ogj8qvashWKnOc1M2U8Z2vgRLwoaEz6WIRP48FfBClFHHpWZyCrnKYa6VCiUT y5bZ8fsrNxEhjdCamH+pS6K33HC3fXxCS0glRqjWc6kQIKlhbmdDY94igUrOCHp/x qkJ3rKWJV+EbfG3DiA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQv8x-1rNLwx2JPD-00Nyba; Mon, 12 Feb 2024 22:14:44 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods In-Reply-To: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> (Sean Devlin's message of "Mon, 12 Feb 2024 15:08:46 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> Date: Mon, 12 Feb 2024 22:14:43 +0100 Message-ID: <875xytjsfw.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:mX+xRLSeVPPU2TQpZ9yJP/1yAJ80h4Qhri34qZPwvKnxogx4uAj 2Rn2Rl48c1jIMIzMzaD/tgFKbVHabUKy7M+/LDX1H1A2vmgXlvdJ7OSd5T+UuhTuaR3eCGx zwtA8lNLJMlE+sUdCojmhYk/VTgZSeXNKAYVJ8vuFfZS/ykHV949kgL9PFnrRmAPY6MH6v6 dcy/esU2qoBedN8hL6QGg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:8jSULOlqQJ0=;bMTEGMZqtXVhB5PkXJ7okqnhYCV 5VSU2Cm/YYHs8H9fE2YdgE+VQsvTwBYdxbiU0ZW8GwOEzlKCpq9miEwr05OcJAHjemmFuhgdc tGOnYnnduN7g/Br6xHoEq9oub7vhv9D04G1TubbjgGDYlVL01ImRckerCR7nr2XDEO/zeuu2u Ria4UfcC2+flp2k2X9QvnrpIoIHVOomS7xfm/yGI1ajONvdKijSqmmcDe0Fw2EUiM2R9S7kAJ npSCKLsn3Q2RNpJEuCNCaULaTOZmBynLdu3vG9jSIFawAdKL7fD0AmsRRtSLODKEKwOAGGS7W OObiwKkOCR1RQYFd4zV8OjdRS6q4Ra8AnLNgJ3cNUbnDhnB0FSAkuyf103u46LojhtaodPbpF IMzH7oeoTbIS7uHzpa2h5/cDF/iXPR3uG4HdBWgfoWhtfXNVMqA5sH7iIq9t4JfxE2BcD0zwW 0HLmoBSmsvjY/DI+Qeo2KW19c8A8kcUKVsYQJbnnr4bFvAZivK4wjcKKtGjMx13XpYqOi/XWI FjpiOWZMT8Mc7RPAAVXWssjI8Ba8ZbKdCfiBuIMNq17+hqKMwK6X2z/uFh6voAMOPsmznZsWs xYax91qBfHVZKrW45MxkZ+sLFeZRxkNkX2QteEWEx9BGY8+SxufIKvIna1myVFAiuti4weaSr 4PxPG35wpIO3EXMO0qcth3Z1Xgm5fw66tHk7K1dZSP1bCo92o2ZEPIO4D2gLdjyvo5dZHo1W2 J36w33aiTrruwSY2vCC4N+8lJ42ZZSEg5gnTNxycVKacUqkBA/orsSXDDmF+ks984aBy+UuNu J8egwPgd8GKTkQnOczSWwgtA0c1kOv6KUgw2QXwh9ojW6j4J/CBWBNpJSy6JAVrpgE Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sean Devlin writes: > Hi folks, Hi Sean, Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.16 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.17.22 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sean Devlin writes: > Hi folks, Hi Sean, Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.17.22 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.16 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Sean Devlin writes: > Hi folks, Hi Sean, > This is a feature request. > > Tramp lets you define a method for out-of-band file copying with the > tramp-methods keys tramp-copy-program, tramp-copy-args, and so on. > > Currently, there is no way to customize the format of remote file > paths. The function tramp-make-copy-program-file-name is responsible for > this job, and it is hard-coded to format files as USER@HOST:FILE. No. USER@HOST:FILE is only taken if the remote file name contains a user. Otherwise, it takes HOST:FILE. > I was working on a custom Tramp method, and I ran into problems setting > up OOB copying due to this limitation. > > It would be great if there were a key you could set in tramp-methods to > override this logic. For example, maybe something like: > > (tramp-copy-format-file-name my-tramp-make-copy-program-file-name) > > Where my-tramp-make-copy-program-file-name is a function taking a vector > as input and returning a string of the formatted file name (similar to > tramp-make-copy-program-file-name). > > Alternately, maybe a format string (or something similar to > tramp-login-args/tramp-copy-args) would be sufficient. In my case, I > just need to add a constant prefix to the remote file name, so a format > string would be fine. Could you pls show your custom method spec, and what tramp-copy-format-file-name returns for it? > Thanks! Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 12 16:16:57 2024 Received: (at 69085) by debbugs.gnu.org; 12 Feb 2024 21:16:57 +0000 Received: from localhost ([127.0.0.1]:59867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZdfd-0007Mh-FU for submit@debbugs.gnu.org; Mon, 12 Feb 2024 16:16:57 -0500 Received: from mout.gmx.net ([212.227.17.20]:39953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZdfb-0007M6-U8 for 69085@debbugs.gnu.org; Mon, 12 Feb 2024 16:16:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707772592; x=1708377392; i=michael.albinus@gmx.de; bh=OKoy7ddHiNZZoQPdNYR3jm3Lr5d6WOZ1V4kgFjKfaJY=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=Ys05RxlV3GczCSLxY3vn+UHZbKx7yhxHAh+tXavuKdqw8a9GshWqA3GPS3DLZ7uK i3u+KwdHKRwhOOpcH5OqcPmWyQ0Mzqt6QZrP93eZ4dN51m0qegM3jFSDSuMeWeIRr QJ9eAT76RMwHe9IjB5L0RsQCOlAy/jyoOI5MRSHY8hGJ/OiY8yi5k/Ro2M4TOy6HT 0P4x8/GgR4QdQwpW2Ps3tY1++CuSVE5f4xqXQXqQnm1/bNwcZ0Jr5PDOYWmMVU0Ij 6OZ7MfqCIwBepfmHqy+xJjoxUXpjJATDe6S+geg1H6N5AdDTq1HJJibiYLYtVc9VE LauXu7pRORMJFdQNNQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1wll-1qpfsP1UIT-012DgQ; Mon, 12 Feb 2024 22:16:32 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: Acknowledgement (29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods) In-Reply-To: (Sean Devlin's message of "Mon, 12 Feb 2024 15:14:36 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> Date: Mon, 12 Feb 2024 22:16:31 +0100 Message-ID: <871q9hjscw.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:uz3Lv5crjXdnt3tLDvbkL51HsxPIfEM6x+YYaTHjOmiXdI66d0P xkOmzWbnbxgI9OLZExUKkK7xRVfprwXMDtQOn3eqUUXvRqOZV6r5S85WKTFtZ2ZTmCH0Iid /BNpExmZcrFJ12JwlNrBMOzpZQPuuKqdGU/Dyy1cII4kbL3YZj7gq8vQTqrKjQjLmYpzZj8 Pw/ox55YNaTLY4pLL/NfA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:E+x0Z6XjO08=;GCGUPCi9QcymdAKgxeO0W1BMwQa e8E2/+IROMdPw9/rIotU/CSCOeD+GNq+lcE9gVMuE52bxleGwIDY6XyiQNimc9FjZOezYqc2N fFVq7nCgsZclaaK5F1DuMGuluTX+2snkjATouU29rOO4z2oD/MgUYs7C9H2FLDFpLcYkFd8J5 1jgRzRlJVWcNDYSpwJ9uEbwnbbT2FrM39qCpHa6FLCw5xHTojC4h8UJUB9fadxl861AwcpXfB deMudWAqEb4vzG31bEDWLM7TlxAZE5HriqFiAJF85KGGiPNCdLH0mROEu2qnI6Ht/pbkn9xHH HXU4lj3fdr7+OnifKDPZdCfZygHGHRlvtV3CB+hCl8VeYlezOHFfrk9ZX/Wq3iopc1cXkjQsW GGDloo0W1oS0/tk2oz0WT7bS01w5LRQ+MGAb0MByjgVewm/DCXvcQdCluQNNZKzAVzL6r6uF+ p9HQy1EArV6DpN/h5ytwAEvRXen1FmCCDKFqep4KBfu6HTqFY2eLbP48Fug8NXbWmVCjYPOwO RtFDQhONsKAjhNfyfP4jlilX8yyFO8ggj5xcIAG1SEo5jx2OlTY//TCCBp/PRnWRSNd09cdij jHVICZzrHhzKT4pZI0XQilIZoV2i2peHQnLu5AjQlzpHm0hxDaVerHXH2BP7eAv1PMust1tID 7W4fWivx997yIccUX8ODu8q9/xJ6ciHpTWe4EqidCHTNljZmyGVvCXaDNkqnKQbnyqwBz3/U2 YK0fE7efemvW0afzcSW9liEjYG4CeMUAjm2k7RVPJxNLDrwNAww4ZZuiacc1rNZEu5FIrHwG8 iK1wqdt5CS4dJwDWLUIgSaeNAyLGzTwQg2M94ecDfq697TjhoB9eh9bXrJ1E9Fj03Z X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sean Devlin writes: Hi Sean, > I was able to work around the issue by advising tramp-make-copy-program-file-name: > > (defun tramp-mymethod-make-copy-program-file-name (vec) > (when (tramp-mymethod-file-name-p vec) > (let ((local [...] Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.16 listed in zen.spamhaus.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sean Devlin writes: Hi Sean, > I was able to work around the issue by advising tramp-make-copy-program-file-name: > > (defun tramp-mymethod-make-copy-program-file-name (vec) > (when (tramp-mymethod-file-name-p vec) > (let ((local [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.16 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Sean Devlin writes: Hi Sean, > I was able to work around the issue by advising tramp-make-copy-program-file-name: > > (defun tramp-mymethod-make-copy-program-file-name (vec) > (when (tramp-mymethod-file-name-p vec) > (let ((localname > (directory-file-name (tramp-file-name-unquote-localname vec)))) > (format "myprefix:%s" localname)))) > > (advice-add 'tramp-make-copy-program-file-name > :before-until #'tramp-mymethod-make-copy-program-file-name) It is nice that it works for you. But as I said the other message, I'd like to understand the problem. So pls show your custome method spec. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 12 17:25:24 2024 Received: (at 69085) by debbugs.gnu.org; 12 Feb 2024 22:25:24 +0000 Received: from localhost ([127.0.0.1]:34813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZejr-0006Qs-49 for submit@debbugs.gnu.org; Mon, 12 Feb 2024 17:25:24 -0500 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:55737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZecy-0005WI-NJ for 69085@debbugs.gnu.org; Mon, 12 Feb 2024 17:18:17 -0500 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-78684496b10so38828085a.3 for <69085@debbugs.gnu.org>; Mon, 12 Feb 2024 14:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1707776274; x=1708381074; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=R3Tlz/TTEDCsjYFEVVaVgtuWtN5vm6KnKtVaqhLbIH8=; b=O4mfz8ciB0Cxgh8ivvyEwNmKhRspTGvL+SU5pG/o1Q5UWXxSrWmUT/X56e+ooDpQGL TPaVWBEaBxc7jNUVMVYZ2KBUdl1hRQyvQeFiB+Qbk5V6tAvsJvifpe97Zo1XF4VU9yxs yhAy6jSsD0i04PmAE/FJJmXV5n0Jt9le+JrDXLmMKcZnLAeNbOOJhtLfYn/fM5Qxib27 n/v+0efizzWn0g2y+pkDd3oDjARS+knqn2TxZqLoV7eftGgTLy8P19IU1vJ+Ps7FPpbw KVrvHsUw7irAnYU4RI75Wkx5IdqKIQACbu6FpH5urvkFfN+OcShUVoAIQtRoAvIhaJ7B WuQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707776274; x=1708381074; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R3Tlz/TTEDCsjYFEVVaVgtuWtN5vm6KnKtVaqhLbIH8=; b=fBbiqB3MpSmP6q7gLEdLxMoKsxWUb3UJynZTgDZVjY2rLrZjfGCuhzYfRyB4NnMHTV CfY06awUZA/KlTnj4SImiWJYki+DGS2q2l062zOHnPgXMTlzjnux/73yFDeq9+ascIEb q3j3kx0vJZvHijnG+UIDXz3UasbTMKQzSy7MEi6VmkTQd9yvaXFzUH2KmzTAowct4hcN PW9w+r2GNjrCbj5rXW3449bX1R1ysM1PrDC3OPc4C3dCGWzT9d7dQUgsLiZSx9rLAzCY eBOJIyca+SwCFqB/mG8lZ0O7UzxkE/KICq42AW8iPw99R6BquxKQb3SCNvLAC3bHwk47 ouCw== X-Gm-Message-State: AOJu0YyPd+9kGGZ8q1nStGrTgP6pZdUS7qwu4NvvFB2hM5lcac38SFKo sAAHc20l/nlXLr8sxGZlBRQyBzjsaSerNtgVKWpzEueuh2QRbYm2XKSdsJUHgbTDf+8wsWov3nB 8 X-Google-Smtp-Source: AGHT+IEMQNuJGDNn13eXoJ3bD7YTUeoF41n7DoVacn+58Coel+Uu33HABbVSzmh6Eem16QnFZk+yQw== X-Received: by 2002:a5b:b49:0:b0:dc7:5f01:7a3 with SMTP id b9-20020a5b0b49000000b00dc75f0107a3mr6421091ybr.21.1707774706309; Mon, 12 Feb 2024 13:51:46 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id w17-20020ae9e511000000b007856bff53d3sm2385546qkf.54.2024.02.12.13.51.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2024 13:51:45 -0800 (PST) From: Sean Devlin Message-Id: <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_441A4680-A04B-44C8-97EC-BBC4473BBEC4" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods Date: Mon, 12 Feb 2024 16:51:35 -0500 In-Reply-To: <875xytjsfw.fsf@gmx.de> To: Michael Albinus References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_441A4680-A04B-44C8-97EC-BBC4473BBEC4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Michael, > On Feb 12, 2024, at 4:14=E2=80=AFPM, Michael Albinus = wrote: >=20 > Sean Devlin > writes: >=20 >> Hi folks, >=20 > Hi Sean, >=20 >> This is a feature request. >>=20 >> Tramp lets you define a method for out-of-band file copying with the >> tramp-methods keys tramp-copy-program, tramp-copy-args, and so on. >>=20 >> Currently, there is no way to customize the format of remote file >> paths. The function tramp-make-copy-program-file-name is responsible = for >> this job, and it is hard-coded to format files as USER@HOST:FILE. >=20 > No. USER@HOST:FILE is only taken if the remote file name contains a > user. Otherwise, it takes > HOST:FILE. You=E2=80=99re correct, my mistake. >=20 >> I was working on a custom Tramp method, and I ran into problems = setting >> up OOB copying due to this limitation. >>=20 >> It would be great if there were a key you could set in tramp-methods = to >> override this logic. For example, maybe something like: >>=20 >> (tramp-copy-format-file-name my-tramp-make-copy-program-file-name) >>=20 >> Where my-tramp-make-copy-program-file-name is a function taking a = vector >> as input and returning a string of the formatted file name (similar = to >> tramp-make-copy-program-file-name). >>=20 >> Alternately, maybe a format string (or something similar to >> tramp-login-args/tramp-copy-args) would be sufficient. In my case, I >> just need to add a constant prefix to the remote file name, so a = format >> string would be fine. >=20 > Could you pls show your custom method spec, and what > tramp-copy-format-file-name returns for it? Tramp-copy-format-file-name was just a proposal for how this feature = might work; it doesn=E2=80=99t exist in my own custom method spec. The copy parameters for my method look like so: (defconst tramp-mymethod '("mymethod" ... (tramp-copy-program =E2=80=9Cmy-copy-program") (tramp-copy-args ((=E2=80=9C-id" "%h"))))) Invocations of the copy program look like: my-copy-program -id HOST SRC-FILE DEST-FILE The HOST is not a DNS name in this case; instead, it=E2=80=99s an = identifier for a sort of abstract container. For SRC-FILE and DEST-FILE, =E2=80=9Cremote=E2=80=9D file paths just = have a fixed prefix string, i.e. it=E2=80=99s not dependent on the =E2=80=9Chost=E2=80=9D name or = the user. So all I really need is a way to format =E2=80=9Cremote=E2=80=9D file = paths like: (format "myprefix:%s" localname) The current hack I use to implement this is to advise = tramp-make-copy-file-name as described in my other message. Thanks for your help! >=20 >> Thanks! >=20 > Best regards, Michael. --Apple-Mail=_441A4680-A04B-44C8-97EC-BBC4473BBEC4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi Michael,

On Feb 12, 2024, at 4:14=E2=80=AFPM, Michael Albinus = <michael.albinus@gmx.de> wrote:

Sean = Devlin <spd@toadstyle.org> writes:

Hi folks,

Hi Sean,

This is a feature request.

Tramp lets you = define a method for out-of-band file copying with the
tramp-methods = keys tramp-copy-program, tramp-copy-args, and so on.

Currently, = there is no way to customize the format of remote file
paths. The = function tramp-make-copy-program-file-name is responsible for
this = job, and it is hard-coded to format files as = USER@HOST:FILE.

No. = USER@HOST:FILE is only taken if the remote file name contains = a
user. Otherwise, it = takes
HOST:FILE.

You=E2=80=99re correct, my = mistake.


I was working on a custom Tramp method, and I = ran into problems setting
up OOB copying due to this = limitation.

It would be great if there were a key you could set = in tramp-methods to
override this logic. For example, maybe something = like:

(tramp-copy-format-file-name = my-tramp-make-copy-program-file-name)

Where = my-tramp-make-copy-program-file-name is a function taking a vector
as = input and returning a string of the formatted file name (similar = to
tramp-make-copy-program-file-name).

Alternately, maybe a = format string (or something similar = to
tramp-login-args/tramp-copy-args) would be sufficient. In my case, = I
just need to add a constant prefix to the remote file name, so a = format
string would be fine.

Could = you pls show your custom method spec, and what
tramp-copy-format-file-name returns for = it?

Tramp-copy-format-file-name = was just a proposal for how this feature might
work; it = doesn=E2=80=99t exist in my own custom method = spec.

The copy parameters for my method look = like so:

(defconst = tramp-mymethod
  '("mymethod"
    = ...

    (tramp-copy-program = =E2=80=9Cmy-copy-program")
    = (tramp-copy-args
     ((=E2=80=9C-id" = "%h")))))

Invocations of the copy = program look like:

my-copy-program -id HOST = SRC-FILE DEST-FILE

The HOST is = not a DNS name in this case; instead, it=E2=80=99s an identifier for a = sort of
abstract container.

For = SRC-FILE and DEST-FILE, =E2=80=9Cremote=E2=80=9D file paths just have a = fixed prefix string,
i.e. it=E2=80=99s not dependent on the = =E2=80=9Chost=E2=80=9D name or the user.

So all = I really need is a way to format =E2=80=9Cremote=E2=80=9D file paths = like:

(format "myprefix:%s" = localname)

The current hack I use to implement = this is to advise tramp-make-copy-file-name
as described in my = other message.

Thanks for your = help!


Thanks!

Best = regards, Michael.

= --Apple-Mail=_441A4680-A04B-44C8-97EC-BBC4473BBEC4-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 13 07:18:41 2024 Received: (at 69085) by debbugs.gnu.org; 13 Feb 2024 12:18:41 +0000 Received: from localhost ([127.0.0.1]:42553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZrkH-000149-EQ for submit@debbugs.gnu.org; Tue, 13 Feb 2024 07:18:41 -0500 Received: from mout.gmx.net ([212.227.17.20]:34955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZrkE-00013p-8k for 69085@debbugs.gnu.org; Tue, 13 Feb 2024 07:18:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707826693; x=1708431493; i=michael.albinus@gmx.de; bh=+AuvIs4PtBo8P1Hymf+ASDZoj9wVv/fONVBwNvWyPW8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=OFt6xo+RAnQUt3xTFHsthT03+ytqD2rWlN1lsIA9xOkGzLEzi5FXHb1h1zVV090s D9iKVq5Eo/fo6F0wI6iZ1W4yZJgwiXWUbJFuyTC7KCVaGgbR/e3QARcq31Wxu4NMd mJOJhLMOnD17z/Mo64k82t9PwuSLgcuH5DAXhbidRd0cqh0fKXv8Ti1apzkVTX710 K/lMrOPg7tB9LqVj410E+d1pdi/uAZ4jimNTCopveFS1avJrKOIsqeUmGiKe6bU5N qfDwdDgScRwZy1H6U0on2RLewCI0BlbG7JIQNhfZjBRqaAszZMKg/2wC4stWBdioG z6evz1jAhrXGDhzjjw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MYeMt-1rUaZi1TjX-00Ve5j; Tue, 13 Feb 2024 13:18:13 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods In-Reply-To: <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> (Sean Devlin's message of "Mon, 12 Feb 2024 16:51:35 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> Date: Tue, 13 Feb 2024 13:18:12 +0100 Message-ID: <8734twimm3.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ZiUP7iHQbNPtPWlnGqn+myjYpfZA4G6hRXo4MRFwqIPGibnxtiG bJC1YGSXpkJaCVd6rzmhp3dZcXnhJHQubqcNVLDvWC6nQwPdsPXiterc68A4a3acVUT5DWf s1zzytKFSzmFMP7c9N8ETFJLU6vGvahaEaz+rVOdlM4rBCzInWtNOSzrqyTrbxAuUOiTTMk 8jZTRWbAQRx7NQXIsctFg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:FnGNxuuOL/E=;qIjeHUneek1Kzgr27KXlkEJodOC 9Zy2h0KOivkRQO3hRfjTZgH+6u94xjYOBIISy4gMLQ+nLw9DDL6yquiFqgDmv+6NW2866+yDi 61q/B+pvfGyWgOOq1iSBFfzVic+/5u0Mj3Hb38XkT0tWEidxIpgSMLEvLWyhNGGlZspRPRWG+ qCePf/Ix9hW8/GPVg9Ey1r07vG6gJ6JeqftTLtMzxixYqOitfWxlmV3Q1mrLC7APRvgXwR6J2 /ZAgY7ETNVjxcyMvS1eo0CFEN3YvTJ19S2N/X4J8WLlsFy8YHxYUZ6hMDnwKDg2PX5idX2bm/ eWo4SNlAD5bTrWn5SOXEsfPJe0+CHPGIT0yMa2OwkaBHTxt+KONbMKistjDd0iVdqnJvdZNNM yWSTV+Hmtx0r4t0hWskMmhI76hQsa1BI/fPwpFZNieUluyxz3keJ55w/PNqGL+6n9LNi24B5V t0ifbtsXgj6wKe6bfaygYmMJ/ysZlOEV+YXDqWyHrjC07vKG7QoWjoODJJHgR4YXKovXq1sR5 6N+z9YF1BKJh/IHI0L0BZLatKsy2RcRDfdanlQ4dRQrPWKNdtj8xYaMrGPyS1a2Vt6wv3WP46 Efd48jEGUZY1PX/zLyLPsSj7XHqbPCbV6UIEjBVuCFaDKKOZhx1LDQfWdnD+B59g6718Kuk5Z XqOoPk09v0h7et350EsGkPmQysA5QzZmHI4BIlvm0OF/X7OX0VInLZW1pTBZQ6uBXqZ/xXwdb EoYVdiuuEUdq0NriZx4dDNXxbNsMZee6TwtGflxZGMNSQrc43CP2z+tXtiNK8IXvspTqCMtuU +SW2xI4GkcWwivKlCuhfv1cC3s0/AOjPBWNdbMFFiuPgNTjE972Zl2I2d6kCPQYXaQ X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sean Devlin writes: > Hi Michael, Hi Sean, Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.16 listed in zen.spamhaus.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Sean Devlin writes: > Hi Michael, Hi Sean, Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.39.16 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Sean Devlin writes: > Hi Michael, Hi Sean, > The copy parameters for my method look like so: > > (defconst tramp-mymethod > '("mymethod" > ... > > (tramp-copy-program =E2=80=9Cmy-copy-program") > (tramp-copy-args > ((=E2=80=9C-id" "%h"))))) > > Invocations of the copy program look like: > > my-copy-program -id HOST SRC-FILE DEST-FILE > > The HOST is not a DNS name in this case; instead, it=E2=80=99s an identif= ier > for a sort of > abstract container. > > For SRC-FILE and DEST-FILE, =E2=80=9Cremote=E2=80=9D file paths just have= a fixed > prefix string, > i.e. it=E2=80=99s not dependent on the =E2=80=9Chost=E2=80=9D name or the= user. > > So all I really need is a way to format =E2=80=9Cremote=E2=80=9D file pat= hs like: > > (format "myprefix:%s" localname) Hmm. Some questions: - What if SRC-FILE or DEST-FILE is local, and the other one is remote? Would it still be something like "my-copy-program -id HOST SRC-FILE DEST-= FILE"? - In case both SRC-FILE and DEST-FILE are remote, are they always files on the same remote host identified as HOST? Or do you need also a copy between two different hosts, using "mymethod"? - And if HOST is a kind of container, would it be possible for you to use the "docker" or "podman" method of Tramp directly? > Thanks for your help! Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 13 15:19:45 2024 Received: (at 69085) by debbugs.gnu.org; 13 Feb 2024 20:19:45 +0000 Received: from localhost ([127.0.0.1]:47703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZzFp-0005qR-9U for submit@debbugs.gnu.org; Tue, 13 Feb 2024 15:19:45 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:56645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZzFm-0005qE-UR for 69085@debbugs.gnu.org; Tue, 13 Feb 2024 15:19:43 -0500 Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-42a8900bb93so34770211cf.1 for <69085@debbugs.gnu.org>; Tue, 13 Feb 2024 12:19:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1707855500; x=1708460300; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7qqqouNwioX1b2uliojAwdzbfBhMs65BRyKUXm+tl+g=; b=3IGOYd26j16p9OROFicwYgxn5hpumXse4yPL558Nsn9nsYOU0XAAO9BNLMkcmKkBWN OTVz7qcHbobrLKf7dohGvQYHuNn2dqjWpczZiyTWw0MMhb+9b4HuT6qNFyYFzjhQlXwM ipQDEWErngGj4OSM7KzSYi2Oe2P25mdSGQWOaqo1G6NY0l9mLMhm2AKFABnscr0uS0r4 cTHrhbQ8O/raaN1vBALaxJ3gBKpU/Ei1DW/KgRYCvvkdz7qKFM0amAYawA0xL8/Kdy75 CEBfsIsXIRTNBu4yadUjlUPxFwOXJsPXgtYiYP9kR8iDtHq2dS6HeRVjW51udfekmGC2 NHBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707855500; x=1708460300; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7qqqouNwioX1b2uliojAwdzbfBhMs65BRyKUXm+tl+g=; b=JfaLHdl+DiTcnTy5eGH0yx+lW/RLj9xFcJRZ38jyBXUS2Zt4ytbLu8e8SnhsBEpG3B S6cbKqiZhvG9+JchxLgzezgfZZJA8gRZTNysVHfhPkT8EZshbgwtejmZIkWF9D1QA75R 9n0QammIa5xvZfETBCATEs+YRCgmhp3Idt5pJTbeUUF075CPmfUfYHW9BSjdOTgHn8Bt hh+NwKCRvAPaqenoEmfEqfsJ6rgnbAruwmWyQFPFeF3H9qgRNG0U8RkjXdMBdhdDUWtz 3hIY+qEQsu4YqKKUcuHmtM7YADDr4M9GdW9PnyWfZhEVLaGx+bbsxuN2HE/q6FYD88hP rPYA== X-Gm-Message-State: AOJu0YzFofKHMO0vQkbAVeYbPz4nPC2zki6YigjGosjh6Xj21Uy6+VRe 94N6RtGYRqGIuLKqZXA+c519mC81+PuQPSvxWR/2zALM3fKGTvnCCLYcDrv5R10= X-Google-Smtp-Source: AGHT+IH5A9QoVodOTAxWCX2O6Z9q0IsyoNLRcERHiu3DYs6x0Az2iJEQ2NbaneASASJUiEfRFN1/Vg== X-Received: by 2002:a05:622a:11cb:b0:42c:63ba:2685 with SMTP id n11-20020a05622a11cb00b0042c63ba2685mr555691qtk.60.1707855499733; Tue, 13 Feb 2024 12:18:19 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id l21-20020ac87255000000b0042c7b9abef7sm1395363qtp.96.2024.02.13.12.18.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2024 12:18:19 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods From: Sean Devlin In-Reply-To: <8734twimm3.fsf@gmx.de> Date: Tue, 13 Feb 2024 15:18:08 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> To: Michael Albinus X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Michael, > On Feb 13, 2024, at 7:18=E2=80=AFAM, Michael Albinus = wrote: >=20 > Sean Devlin writes: >=20 >> Hi Michael, >=20 > Hi Sean, >=20 >> The copy parameters for my method look like so: >>=20 >> (defconst tramp-mymethod >> '("mymethod" >> ... >>=20 >> (tramp-copy-program =E2=80=9Cmy-copy-program") >> (tramp-copy-args >> ((=E2=80=9C-id" "%h"))))) >>=20 >> Invocations of the copy program look like: >>=20 >> my-copy-program -id HOST SRC-FILE DEST-FILE >>=20 >> The HOST is not a DNS name in this case; instead, it=E2=80=99s an = identifier >> for a sort of >> abstract container. >>=20 >> For SRC-FILE and DEST-FILE, =E2=80=9Cremote=E2=80=9D file paths just = have a fixed >> prefix string, >> i.e. it=E2=80=99s not dependent on the =E2=80=9Chost=E2=80=9D name or = the user. >>=20 >> So all I really need is a way to format =E2=80=9Cremote=E2=80=9D file = paths like: >>=20 >> (format "myprefix:%s" localname) >=20 > Hmm. Some questions: >=20 > - What if SRC-FILE or DEST-FILE is local, and the other one is remote? > Would it still be something like "my-copy-program -id HOST SRC-FILE = DEST-FILE"? This is the main supported use case. One of the files must be local, and = the other must be =E2=80=9Cremote=E2=80=9D (i.e. it=E2=80=99s inside the container = HOST). The path for the local file is formatted just like a typical local file = path. For the =E2=80=9Cremote=E2=80=9D file, it=E2=80=99s formatted like a = local file path but with a constant prefix in front. The prefix is just a fixed string, and it=E2=80=99s just there to = tell the copy program that the path is inside the container. >=20 > - In case both SRC-FILE and DEST-FILE are remote, are they always = files > on the same remote host identified as HOST? Or do you need also a = copy > between two different hosts, using "mymethod"? Direct copying between two hosts/containers isn=E2=80=99t supported with = this program. To handle this case, you need to copy from one remote to the local system, = and then copy that file into the second remote. Based on my experiments, it seems that Tramp handles this scenario = correctly and uses the local system as an intermediate stop. >=20 > - And if HOST is a kind of container, would it be possible for you to > use the "docker" or "podman" method of Tramp directly? I=E2=80=99ve looked a little bit at the code supporting these methods in = tramp-container.el. They seem similar, but not exactly the same. Also, they do not support = OOB copying, at least in the version of Tramp I=E2=80=99m reading (i.e. the = version packaged with Emacs 29.2). Thanks for your help! >=20 >> Thanks for your help! >=20 > Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 14 02:00:08 2024 Received: (at 69085) by debbugs.gnu.org; 14 Feb 2024 07:00:08 +0000 Received: from localhost ([127.0.0.1]:49862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ra9FX-0004y2-OR for submit@debbugs.gnu.org; Wed, 14 Feb 2024 02:00:08 -0500 Received: from mout.gmx.net ([212.227.17.22]:36287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ra9FU-0004wy-AZ for 69085@debbugs.gnu.org; Wed, 14 Feb 2024 02:00:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707893979; x=1708498779; i=michael.albinus@gmx.de; bh=AML2NXmfX8PiUbHdQABX1u8HT+Qwoj9O5zOKyBktVuM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=A+isyixdldvahdw02dpsU4E22lr9tCSumlIkyTOoMMHqyfyBFd4xg2QijMLSc43H syLV6IEZH/ihzm78QUiqnaNG/rEjQNC54rO3ZZrKevmGkwgb57g9W8aUW7zsz2RWO /giMPOcBhBKQAtsKWOTtUlVSRng7Sswyt/tMI6vqUy8yAmkKgaZHlrmNieNUxGJjV rlRPxcjBP+GypoDB6xZAXbtgbVlqpZP+/dS912cYjyMs22TRAF/Hs3Jy/54HyCHiL Fug3CnQhsFR23U923WHqO17k9xJgCZvNPmMRp+NBjk9VXWm+TKBfFxEiJmI5RCu0Z bDEvi6cdEnAV94cF7A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6lpG-1rbozl2JBu-008NyO; Wed, 14 Feb 2024 07:59:39 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods In-Reply-To: (Sean Devlin's message of "Tue, 13 Feb 2024 15:18:08 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> Date: Wed, 14 Feb 2024 07:59:38 +0100 Message-ID: <87r0hfh6p1.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:e33f67WcxXsr2Ij8UyVXPzy3DdSxOYGb2D/v6y06O1AREz4+c2b C5KGDtORniY+/mHRKBOvepZj6EY0wShsipfZ2Ued9Pyjf6KXchDklytrb3RGMpCh06/QikU j+7yJ4rDKgC2cySkazw1a3ZS3zLnjbGYsqw1EJCk71yeWW1aMF2ZjcsAJgz3xiN28OOjQGo 2tTazKyWbOntUrmAonPEQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:zlRCuKnZ008=;dEnMwdiLtHaDAjIitopOok2zmSK rPDsVh/KhZVWnHGxx/p+iC2FaZOny3mqiw3PdITLti1yGDFL/CcRVm6kUtpypoXKRGD5PJJd+ NRqNZfe1ARITNZeKG4TN6zA4iiEIN5WaMEjwAb5q0Z2AfmSW+7l74ytMlhI4/3GgNUuEPegBU W6hIJFPttNdFTXw5Oc3we3YTBjYi69KxY3wgj5U1lQKxxQ/XfN2+4owYeGa6XrZ7Ppt7paC0B 3Kx4bxytVRvhtJiWemti9iPf1HVG15SVxpDP0eHeLtGFzcYvaoVK4EO8wIW+sInSRnpOgcHws 7H804dsGVOC/+GM4d9H0wCC8FrO5IdoTsKsgfr0cspqB8FO4OyHvEBMiUHnHVzwuKgrDPKBwp BBNgf8ALKZV391xNhtMOKGIxjmEXfmXtEQdoU/S0M0TQ6dCXCXSmLMtKJGxj25wZtvfyS43Z5 h/lO5/cNVa2RCSLvMs4888gBp4QYI1KwgnIw5wa6fceDGiGmldqjRzjgaMZ8q6UC/BxKtj7Yh REXmza9RWetiliGq4L9UliHWybTlxtzNgUkzqXAtzxZZSJSqea7sTfTyPl67tKlhbwMPtUp4Y B/992Dp160mz9FkoeOSTCLe1R+4/USWd/b+eJDEyZWhkqA7IqZbImAaYATjaCNaGJLnP7AAqO dLeK5GSWWOD8+MpK53O4IQG40h4Jane9hAF4mQmhV7D/eEJzA2zH0yoYoKjb0yobGDVojnXLl BY1kFSLD8bN8qbco1uQi2cWAdl+yCB+Sv/JlccDTPuEKwuioZp2GDtmKZjiVNUDtzsn4fKHXB XKSny6TfABrDe5kIpH73eP0Nxyj9UP5vLj3IGNLCd/wYcfHqhpAvq5D7nwdXO4a1ZH X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Sean Devlin writes: > Hi Michael, Hi Sean, =20 >> - And if HOST is a kind of container, would it be possible for you to >> use the "docker" or "podman" method of Tramp directly? > > I=E2=80=99ve looked a little bit at the code supporting these methods in = tramp-container.el. > They seem similar, but not exactly the same. Also, they do not support OOB > copying, at least in the version of Tramp I=E2=80=99m reading (i.e. the v= ersion packaged with > Emacs 29.2). Could you pls elaborate verbosely, what is missing in your use case? Perhaps we could extend tramp-container.el that it is applicable for you as well. (I take the time to invest it with you, because your urgent problem seems to be mitigated by your defadvice.) > Thanks for your help! Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 14 19:58:52 2024 Received: (at 69085) by debbugs.gnu.org; 15 Feb 2024 00:58:52 +0000 Received: from localhost ([127.0.0.1]:53513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raQ5T-0001yW-QD for submit@debbugs.gnu.org; Wed, 14 Feb 2024 19:58:52 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:51433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raQ5Q-0001yE-Vy for 69085@debbugs.gnu.org; Wed, 14 Feb 2024 19:58:50 -0500 Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7872bc61fcbso21922585a.2 for <69085@debbugs.gnu.org>; Wed, 14 Feb 2024 16:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1707958645; x=1708563445; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=rpKDHDbZRs0YzmpjiZ3PVsXL1nYnu0iXD8II1CHQaN0=; b=eGsWDSDyUCclrLIKrJJGc3eNysC6JgdrauRKFAKbc5t963k6tnnY/2fo+juoDc4LRd gpr/mzDolwDekXAGc++g41ezzZc6ut6ArYWX3eQh14njocxVIVgOKe+hin+kkKyBrGtd RBQ3VRlxnQo9/qMr9lCkpbRMLQ6OICBbxZ8htuFdPDl+JegPqWDx9tfLycCaqGgA+MfH 4O5JK+OQwhx6lHF5pUsyKsRyFOOlviOIaT5OT4zgI0m1k6IK7ab3Jxo+UTNkJDjfTGm+ mSBNLVP+KvIFXE3AmNrmaBWNHqquLGZOaNXAIacDuYzWkL054/HaIlvafjbsfTySRC61 7D4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707958645; x=1708563445; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rpKDHDbZRs0YzmpjiZ3PVsXL1nYnu0iXD8II1CHQaN0=; b=AnmriGTET9RnbTYaTgvZR4bk0kScLDAI43UFUjY06InpXfEVNW1wYNaEApjuhOwTq8 uw62R5D1jnwlqiFOJIRBbloyGVe530zJZiHiIfvHyL3tDE0lfxAnO9hJhyRvmiCDhOj8 MNllDrv3EvTZrdQhzgQARV5cZzr15p/3P5ZDuw5sfVDZfm4mByWz/WMxLzvZ3/OCRH/j vM/O1ueLKGaqvI00o4U0cezC0j86K8VL9hhkuuHyQ3nHUfXcZow0oVm7/Jhr3wiGwLmS 0+pLtiiS0pufPTtYehKQIJWdt/zUfKT1prajVvgpnhXdNNd5X9PUVZzDCda/5JbIBFvx fwfQ== X-Gm-Message-State: AOJu0YxS9eznJwcohwSVv/rBQnUD7QVqyeQ4g+2JUbulFaWU8LP8eXk5 9ul6LpfdYkBzByfPVgQ9E++zKVr7XtZBegAV621fKfS5fin4dNi2tkoNAx3M0cdxNpxYX+ijEU2 v X-Google-Smtp-Source: AGHT+IHPLbuUbAeuU8x4LKFj0RoGVB7Q5yP9CeEifb/1riT37sBMEVg4Y96qN29lcZNlzpa2CS6vsg== X-Received: by 2002:a05:620a:2014:b0:785:d36b:a324 with SMTP id c20-20020a05620a201400b00785d36ba324mr397284qka.39.1707958645020; Wed, 14 Feb 2024 16:57:25 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id po26-20020a05620a385a00b00785d4d5768bsm146386qkn.11.2024.02.14.16.57.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2024 16:57:24 -0800 (PST) From: Sean Devlin Message-Id: <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_53BEAA79-08C6-40E9-AB1A-16F98E517D08" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods Date: Wed, 14 Feb 2024 19:57:13 -0500 In-Reply-To: <87r0hfh6p1.fsf@gmx.de> To: Michael Albinus References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) --Apple-Mail=_53BEAA79-08C6-40E9-AB1A-16F98E517D08 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Michael, > On Feb 14, 2024, at 1:59=E2=80=AFAM, Michael Albinus = wrote: >=20 > Sean Devlin writes: >=20 >> Hi Michael, >=20 > Hi Sean, >=20 >>> - And if HOST is a kind of container, would it be possible for you = to >>> use the "docker" or "podman" method of Tramp directly? >>=20 >> I=E2=80=99ve looked a little bit at the code supporting these methods = in tramp-container.el. >> They seem similar, but not exactly the same. Also, they do not = support OOB >> copying, at least in the version of Tramp I=E2=80=99m reading (i.e. = the version packaged with >> Emacs 29.2). >=20 > Could you pls elaborate verbosely, what is missing in your use case? > Perhaps we could extend tramp-container.el that it is applicable for = you > as well. Sure, let=E2=80=99s focus on tramp-container.el. I think this will allow = us to be concrete, which will make things simpler to discuss. Suppose we want to add OOB copying to the Docker method. Docker has a copy command with usage like this: Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH We could try to add support to the Docker method for OOB copying by starting Emacs -Q and evaluating these forms: (require 'tramp-container) (add-to-list 'tramp-methods `(,tramp-docker-method (tramp-login-program ,tramp-docker-program) (tramp-login-args (("exec") ("-it") ("-u" "%u") ("%h") ("%l"))) (tramp-direct-async (,tramp-default-remote-shell "-c")) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-i" "-c")) (tramp-copy-program ,tramp-docker-program) (tramp-copy-args (("cp"))) )) Outside of Emacs, start a Docker container running some image (e.g. ubuntu:latest). An example command is: $ docker run -it ubuntu:latest bash -l Leave this running. Next, create a large (i.e. greater than tramp-copy-size-limit) temporary file for copying: $ head -c 20000 /dev/random > /tmp/bigfile Back in Emacs, evaluate these forms (with =E2=80=9Cmy_container=E2=80=9D = replaced with the name of your container): (copy-file "/tmp/bigfile" "/docker:my_container:/tmp/bigfile") (copy-file "/tmp/bigfile" "/docker:root@my_container:/tmp/bigfile2=E2=80=9D= ) The first copy will succeed, but the second will fail. This is because = the connection has an explicit user, so it will try to run a command like: docker cp /tmp/bigfile root@my_container:/tmp/bigfile2 It will fail because it will interpret =E2=80=9Croot@my_container=E2=80=9D= as the container=E2=80=99s name, and it will say that there is no container by that name. I think what is needed is some way for the tramp-docker method to = specify the format for remote paths in the OOB copy command, since tramp-make-copy-program-file-name will include the user if it is = specified in the connection. One method might be to add a key to tramp-methods that lets you specify the format similar to tramp-login-args and tramp-copy-args: (tramp-copy-remote-file-format (("%h" ":" "%f"))) Where =E2=80=9C%h=E2=80=9D and =E2=80=9C%f=E2=80=9D are the host and the = file=E2=80=99s local name, respectively. Like tramp-login-args, the format could be a list of lists, and sublists = could be ignored when the required properties are absent. For example, the format for scp-like copy programs might look like this: (tramp-copy-remote-file-format (("%u" "@") ("%h" ":" "%f"))) Where =E2=80=9C%u=E2=80=9D is the user. So the leading =E2=80=9Cuser@=E2=80= =9C could be dropped if the user is unspecified. Unlike tramp-login-args and tramp-copy-args, this would need to concatenate the strings together without spaces. The function tramp-make-copy-program-file-name could check for this method parameter and, if present, use it to format the result. For = example, the cond at the end could be changed like so: (let ((fmt (tramp-get-method-parameter vec = 'tramp-copy-remote-file-format))) (cond ((tramp-get-method-parameter vec 'tramp-remote-copy-program) localname) (fmt ;; Format the file name using fmt. ) ((tramp-string-empty-or-nil-p user) (format "%s:%s" host localname)) (t (format "%s@%s:%s" user host localname))) Instead of a list of lists of strings, another method would be to = specify a function that does the work. The function could take the vector as input = and return the formatted file name. The tramp-make-copy-program-file-name function could call that function (if specified) at the same place in = that cond form. This would be more flexible than the list of lists of strings, but = it also would be more complicated for the implementer and may be overkill. >=20 > (I take the time to invest it with you, because your urgent problem = seems > to be mitigated by your defadvice.) I appreciate your help=E2=80=94thank you for taking the time! >=20 >> Thanks for your help! >=20 > Best regards, Michael. --Apple-Mail=_53BEAA79-08C6-40E9-AB1A-16F98E517D08 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi Michael,

On Feb 14, 2024, at 1:59=E2=80=AFAM, Michael Albinus = <michael.albinus@gmx.de> wrote:

Sean Devlin = <spd@toadstyle.org> writes:

Hi = Michael,

Hi Sean,

- And if HOST is a kind of = container, would it be possible for you to
use the "docker" or = "podman" method of Tramp directly?

I=E2=80=99ve = looked a little bit at the code supporting these methods in = tramp-container.el.
They seem similar, but not exactly the same. = Also, they do not support OOB
copying, at least in the version of = Tramp I=E2=80=99m reading (i.e. the version packaged with
Emacs = 29.2).

Could you pls elaborate verbosely, what is = missing in your use case?
Perhaps we could extend tramp-container.el = that it is applicable for you
as = well.

Sure, let=E2=80=99s = focus on tramp-container.el. I think this will allow us to = be
concrete, which will make things simpler to = discuss.

Suppose we want to add OOB copying to = the Docker method. Docker
has a copy command with usage like = this:

Usage: =  docker cp [OPTIONS] CONTAINER:SRC_PATH = DEST_PATH|-
docker cp = [OPTIONS] SRC_PATH|- = CONTAINER:DEST_PATH

We could try to add = support to the Docker method for OOB copying by
starting Emacs = -Q and evaluating these forms:

(require = 'tramp-container)
(add-to-list 'tramp-methods
  =           =  `(,tramp-docker-method
        =        (tramp-login-program = ,tramp-docker-program)
          =      (tramp-login-args (("exec")
    =                     =           ("-it")
    =                     =           ("-u" "%u")
    =                     =           ("%h")
=          ("%l")))
  =     (tramp-direct-async (,tramp-default-remote-shell = "-c"))
              =  (tramp-remote-shell ,tramp-default-remote-shell)
  =             =  (tramp-remote-shell-login ("-l"))
      =          (tramp-remote-shell-args ("-i" = "-c"))

      = (tramp-copy-program ,tramp-docker-program)
  =     (tramp-copy-args (("cp")))
  =     ))

Outside of Emacs, start = a Docker container running some image (e.g.
ubuntu:latest). An = example command is:

$ docker run -it = ubuntu:latest bash -l

Leave this = running.

Next, create a large (i.e. greater = than tramp-copy-size-limit) temporary
file for = copying:

$ head -c 20000 /dev/random > = /tmp/bigfile

Back in Emacs, evaluate these = forms (with =E2=80=9Cmy_container=E2=80=9D replaced with
the = name of your container):

(copy-file = "/tmp/bigfile" = "/docker:my_container:/tmp/bigfile")

(copy-file = "/tmp/bigfile" = "/docker:root@my_container:/tmp/bigfile2=E2=80=9D)

The first copy will succeed, but the second will fail. This is = because the
connection has an explicit user, so it will try to = run a command like:

docker cp /tmp/bigfile = root@my_container:/tmp/bigfile2

It will fail = because it will interpret =E2=80=9Croot@my_container=E2=80=9D as the = container=E2=80=99s
name, and it will say that there is no = container by that name.

I think what is needed = is some way for the tramp-docker method to specify
the format = for remote paths in the OOB copy command, = since
tramp-make-copy-program-file-name will include the user = if it is specified
in the = connection.

One method might be to add a key to = tramp-methods that lets you specify
the format similar to = tramp-login-args and = tramp-copy-args:

(tramp-copy-remote-file-format = (("%h" ":" "%f")))

Where =E2=80=9C%h=E2=80=9D = and =E2=80=9C%f=E2=80=9D are the host and the file=E2=80=99s local name, = respectively.

Like tramp-login-args, the format = could be a list of lists, and sublists could
be ignored when = the required properties are absent. For example, the
format = for scp-like copy programs might look like = this:

(tramp-copy-remote-file-format
 (("%u" "@")
  ("%h" ":" = "%f")))

Where =E2=80=9C%u=E2=80=9D is the = user. So the leading =E2=80=9Cuser@=E2=80=9C could be dropped if = the
user is unspecified.

Unlike = tramp-login-args and tramp-copy-args, this would need = to
concatenate the strings together without = spaces.

The function = tramp-make-copy-program-file-name could check for this
method = parameter and, if present, use it to format the result. For = example,
the cond at the end could be changed like = so:

(let ((fmt (tramp-get-method-parameter = vec 'tramp-copy-remote-file-format)))
  = (cond
   ((tramp-get-method-parameter vec = 'tramp-remote-copy-program)
    = localname)
   (fmt
    ;; Format = the file name using fmt.
    )
  =  ((tramp-string-empty-or-nil-p user) (format "%s:%s" host = localname))
   (t (format "%s@%s:%s" user host = localname)))

Instead of a list of lists = of strings, another method would be to specify a
function that = does the work. The function could take the vector as input = and
return the formatted file name. The = tramp-make-copy-program-file-name
function could call that = function (if specified) at the same place in that cond
form. = This would be more flexible than the list of lists of strings, but it = also
would be more complicated for the implementer and may be = overkill.


(I take = the time to invest it with you, because your urgent problem seems
to = be mitigated by your = defadvice.)

I appreciate = your help=E2=80=94thank you for taking the time!


Thanks for your = help!

Best regards, = Michael.

= --Apple-Mail=_53BEAA79-08C6-40E9-AB1A-16F98E517D08-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 16 09:55:25 2024 Received: (at 69085) by debbugs.gnu.org; 16 Feb 2024 14:55:25 +0000 Received: from localhost ([127.0.0.1]:58590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1razcb-0003Ro-2T for submit@debbugs.gnu.org; Fri, 16 Feb 2024 09:55:25 -0500 Received: from mout.gmx.net ([212.227.17.22]:38043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1razcW-0003Lg-Nl for 69085@debbugs.gnu.org; Fri, 16 Feb 2024 09:55:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708095294; x=1708700094; i=michael.albinus@gmx.de; bh=AHgswbEPXnGMUMOMni01w/TW4kIOiO6VIFmH+lOBFpE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=Ij6emn1vB4IGKLMf+G7wsGoVN1N7bThBpn4+cv3FrHm4dmA88PdnTYMT3cI/iJH9 NDMeBXNe27t20POiUPFa9uKf0wQ50gxK0zxTvQXcDVyynP2tvhqEmQQafh7BiH52t 198K9PhLJr1ewKuvm1DeDrtUj2hFwbpy9SYmK++9WM73qCzPVQb46aXMVEK5bFkDh YaeqfZlIMXjmPPreGFvQ36xuTYIfZvGl/j0cPOrIkauqPYdL2m5Jr9eONRGGHyY+b JefR+1g4ZTGdG7rx+mEnQdooVQNRUvEpA6H76EHxqDAAvBgtloiKw6hJ/+NNT21B7 0/4MNkRp7etsGLSbrA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mirng-1r5DA20y6m-00exY6; Fri, 16 Feb 2024 15:54:54 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods In-Reply-To: <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> (Sean Devlin's message of "Wed, 14 Feb 2024 19:57:13 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> Date: Fri, 16 Feb 2024 15:54:53 +0100 Message-ID: <87eddctq6a.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:bvBMOpIPbZ0LqwWCMyMUnYZn6jfmp08tWLUfe6qhAkE17816ip9 64pG3o56b3CbnIDltuMmw+83qhKCEfSAGbxJQW4rCBpZVK6BvYIbX69fWJPiR4QNXgVRc7X CpJzqyeEWkTysarkbBQUrriy4nWZOGWTQpLeWFvjFNWcRkzKuzMHt/Cp5uBwiQiEIRN4A+C Zja1PqWWWymzCeJIXPDng== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:2AboKLITOJ4=;j9IMS85TwMHsfw9SHrDuhXDIKkQ bvxuzxacvOyclPzzRSSJ4yR3030k/wR7WxhqN1izgvbhkAcC8UVAQW5IqPq3OrDU3aGMdu+KU 1sw0+ZygejArEz6yOARgOwoCpPfFMfQFpIokePx0c2eQ95yMfpkFX2Oiyk+KSCMC0FHYrRj3f UXeUydAH9WvLo8Zs4JuUL1Jw8BTBgPTDj3TGX+Q0s8sSSEVYKmS9dpXO1KgdhABxAJURjyt6s mJunfeqfOBIcQdFI1j/lpUAZ1Ni32UclMvKAHpyUIzoF6EW+5VIygampGw8sNvEeScPd3vxSd XDVYdlRDnc5GGuA21tqhEf6bIabT/Ew8qt0BzlsICCHNh2EuO10AfGS9FaCL33gB9iAj6yXwR mWK5+OpGaJF7f3Tagoy57EZZSGzASTM+EQJC7G1SSRKBoTtO1zWn5ZNIQmfzK3QTMQK7ishQs /Kr4yiQs9ZqooJz0yOyd3hx8min7GBv9h1bTksW7SY8h/HEfS2q2Xh27eLWczIa1YVU+9cdQ9 /FGe0voor8bpHjgEB6sn1hQEE/thxNrtG8sXcKZJPhPVj/P79m5zaA55UacG9qfNF0aq+n4gx QLEwsrhj6EHD1P9g9WzbVK8bSGorFIrt2/ynPxMjvDU1jHcmnWGh5nFvcHCLfCfNhIq0Ov7mN DlDftuBItJnLH1vVKCvUd7cmxvHyEMXbyv49Td7VJDSfwqK9Q/6JIxNYZCV23YItWOHEhWl4D dz34nS2EYueHCTScUkmEL6kr/rPnoe5MdKzuv5bLiMkru6b2Fge8xByRb+VoGgtz2Z9CqRJwY TfuB0k8xEgVYp8jaTlheaOGQh617o+DoBSlFy9mopNEXnldJ0CETQuirvDribsLAmU X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --=-=-= Content-Type: text/plain Sean Devlin writes: > Hi Michael, Hi Sean, > Suppose we want to add OOB copying to the Docker method. Docker > has a copy command with usage like this: > > Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|- > docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH > > We could try to add support to the Docker method for OOB copying by > starting Emacs -Q and evaluating these forms: > > (add-to-list 'tramp-methods > `(,tramp-docker-method > (tramp-login-program ,tramp-docker-program) > (tramp-login-args (("exec") > ("-it") > ("-u" "%u") > ("%h") > ("%l"))) > (tramp-direct-async (,tramp-default-remote-shell "-c")) > (tramp-remote-shell ,tramp-default-remote-shell) > (tramp-remote-shell-login ("-l")) > (tramp-remote-shell-args ("-i" "-c")) > > (tramp-copy-program ,tramp-docker-program) > (tramp-copy-args (("cp"))) > )) Well, if "docker cp" doesn't need the user, why do we use the user at all? Couldn't we get rid of it in this case? That is, don't use the ("-u" "%u") in tramp-login-args. > I think what is needed is some way for the tramp-docker method to > specify the format for remote paths in the OOB copy command, since > tramp-make-copy-program-file-name will include the user if it is > specified in the connection. > > One method might be to add a key to tramp-methods that lets you > specify the format similar to tramp-login-args and tramp-copy-args: I've tried another approach. In Tramp 2.7, I've added a new method "dockercp" which doesn't use the user at all, and which adds tramp-copy-program and tramp-copy-args. Do you have a chance to install Tramp from its repository like --8<---------------cut here---------------start------------->8--- # git clone https://git.savannah.gnu.org/git/tramp.git --8<---------------cut here---------------end--------------->8--- Then pls modify tramp-container.el with the appended patch. After that, you should be able to access your docker container like /dockercp:CONTAINER:/path/to/file. And if you copy large files, "docker cp" will be applied. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/tramp-container.el b/lisp/tramp-container.el index 1f578949..caea6b47 100644 =2D-- a/lisp/tramp-container.el +++ b/lisp/tramp-container.el @@ -31,6 +31,7 @@ ;; Open a file on a running Docker container: ;; ;; C-x C-f /docker:USER@CONTAINER:/path/to/file +;; C-x C-f /dockercp:CONTAINER:/path/to/file ;; ;; or Podman: ;; @@ -141,6 +142,11 @@ If it is nil, the default context will be used." (defconst tramp-docker-method "docker" "Tramp method name to use to connect to Docker containers.") +;;;###tramp-autoload +(defconst tramp-dockercp-method "dockercp" + "Tramp method name to use to connect to Docker containers. +This is for out-of-band connections.") + ;;;###tramp-autoload (defconst tramp-podman-method "podman" "Tramp method name to use to connect to Podman containers.") @@ -183,7 +189,7 @@ BODY is the backend specific code." (defun tramp-container--completion-function (method) "List running containers available for connection. METHOD is the Tramp method to be used for \"ps\", either -`tramp-docker-method' or `tramp-podman-method'. +`tramp-docker-method', `tramp-dockercp-method' or `tramp-podman-method'. This function is used by `tramp-set-completion-function', please see its function help for a description of the format." @@ -375,6 +381,20 @@ see its function help for a description of the format= ." (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-i" "-c")))) + (add-to-list 'tramp-methods + `(,tramp-dockercp-method + (tramp-login-program ,tramp-docker-program) + (tramp-login-args (("exec") + ("-it") + ("%h") + ("%l"))) + (tramp-direct-async (,tramp-default-remote-shell "-c")) + (tramp-remote-shell ,tramp-default-remote-shell) + (tramp-remote-shell-login ("-l")) + (tramp-remote-shell-args ("-i" "-c")) + (tramp-copy-program ,tramp-docker-program) + (tramp-copy-args (("cp"))))) + (add-to-list 'tramp-methods `(,tramp-podman-method (tramp-login-program ,tramp-podman-program) @@ -431,6 +451,10 @@ see its function help for a description of the format= ." tramp-docker-method `((tramp-container--completion-function ,tramp-docker-method))) + (tramp-set-completion-function + tramp-dockercp-method + `((tramp-container--completion-function ,tramp-dockercp-method))) + (tramp-set-completion-function tramp-podman-method `((tramp-container--completion-function ,tramp-podman-method))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 16 12:52:58 2024 Received: (at 69085) by debbugs.gnu.org; 16 Feb 2024 17:52:59 +0000 Received: from localhost ([127.0.0.1]:60179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb2OQ-0002iJ-H8 for submit@debbugs.gnu.org; Fri, 16 Feb 2024 12:52:58 -0500 Received: from mail-vk1-f179.google.com ([209.85.221.179]:48342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb2OL-0002i4-MW for 69085@debbugs.gnu.org; Fri, 16 Feb 2024 12:52:56 -0500 Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-4c1d1e841e2so244397e0c.0 for <69085@debbugs.gnu.org>; Fri, 16 Feb 2024 09:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1708105888; x=1708710688; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KeajBJr0n1zubNvqS2xr3nP6Kw22klZIedeoTHbtwJg=; b=G57eOYtswcCWUxIsxLmRmKSW2SuyWUSqrBx2M5g9q8oiB5DNMH+U9V757pNtA41A1i 8KgexBk8DtFDR4tJPPArZGPKyTR4Jpfrz+4qmVROut3+XgNVRdtHv+8Naqy0OZ1LETga jGHrc3HXwss5ML4PMRAITWjMSTILk4s57SR8ez95Vvf2rydLxnMv1EoYp8Kur0fDwff5 3pwOgQK919lBAIYsNFL2qXA59udzoIT7cxHnXabjE99I79GhPURjNcZrFuwmQ8RvtbxI WaqSxv/G+bZ9H7q0hQIkECRLU03//QXnUbCIfT0GDR8EFGDx8jAO2QUKJGRHfGPLkzNi I0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708105888; x=1708710688; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KeajBJr0n1zubNvqS2xr3nP6Kw22klZIedeoTHbtwJg=; b=FVzcxLjKxBDQBh7Z7WY4urwfOWSD7cyimckVo4rcHaztok6vXbqb37HI1M4B4sVDxQ X/umZjc4n34GMENLH53wJeHplV+0APxNLi9efo+iydW3/jxSANlxbcj3D/NfMEiEb5Ss Mv6+irB/O7IOyEyccB9UTD8wl/VWucXx7BBwSM9h+54iy/9ePVDjC7UvyvQ1T+ck0gxi ToZ3ZJIhfMfo31bVsgBhSztW0A+XZoY+Uc1UiDjhVcDQradmWnmm7imhi/9eu1876MD2 riTI79uYygeexgg9SX/pOnIx1G+K62qyDOK2PWSFHKjyww9gttYmJefWWrRSQK/QF9sR BT4g== X-Gm-Message-State: AOJu0YwOC0XKEUPl8lwnqccUts8bo3UcNKGhj1CaUFOj3Zy26+nV1cby jNMotn0OIb+71yxWO6Fkjs4p7+o1Jdy9sDTCfjdXwf8QV1ixRrvR+b+kNOGkZWU= X-Google-Smtp-Source: AGHT+IHILLbOqGVD8tiZFI697si2FFrIRnRT3FpR3p0pwv8mH2Y5wRqQC8KzhI//Azo7lKJlD6vKEg== X-Received: by 2002:a1f:ca46:0:b0:4c0:25a4:95bb with SMTP id a67-20020a1fca46000000b004c025a495bbmr4509985vkg.8.1708105888465; Fri, 16 Feb 2024 09:51:28 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id ks6-20020a056214310600b0068f2b9a6ec7sm129805qvb.18.2024.02.16.09.51.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2024 09:51:28 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods From: Sean Devlin In-Reply-To: <87eddctq6a.fsf@gmx.de> Date: Fri, 16 Feb 2024 12:51:17 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> <87eddctq6a.fsf@gmx.de> To: Michael Albinus X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Hi Michael, >> I think what is needed is some way for the tramp-docker method to >> specify the format for remote paths in the OOB copy command, since >> tramp-make-copy-program-file-name will include the user if it is >> specified in the connection. >>=20 >> One method might be to add a key to tramp-methods that lets you >> specify the format similar to tramp-login-args and tramp-copy-args: >=20 > I've tried another approach. In Tramp 2.7, I've added a new method > "dockercp" which doesn't use the user at all, and which adds > tramp-copy-program and tramp-copy-args. >=20 > Do you have a chance to install Tramp from its repository like >=20 > --8<---------------cut here---------------start------------->8--- > # git clone https://git.savannah.gnu.org/git/tramp.git > --8<---------------cut here---------------end--------------->8--- >=20 > Then pls modify tramp-container.el with the appended patch. After = that, > you should be able to access your docker container like > /dockercp:CONTAINER:/path/to/file. And if you copy large files, = "docker > cp" will be applied. The patch does work as described, but it doesn=E2=80=99t integrate well = with typical workflows. For example, I=E2=80=99m likely to start a session from Eshell or Dired = browsing around the remote. At this point, I may not realize I will need to copy = files to or from the remote. I would start with the normal =E2=80=9Cdocker=E2=80=9D= method, because I usually want to have an explicit user for my connection, so that I can = run programs as the user. Now, suppose I do need to copy a file back to the host. I need to: 1. Check the size of the file. If it=E2=80=99s small, I can copy it = normally using the inline method. 2. If the file is big, I now need to switch to the other method, so I = open a new connection to the same container under the =E2=80=9Cdockercp=E2=80=9D = method. 3. I also need to find my way back to the same directory. This may be a minor nuisance, but for example it won=E2=80=99t show up in the Recentf = list, since Emacs and Tramp and Recentf will not know that /docker:user@container:/path/to/dir and /dockercp:container:/path/to/dir = are related. 4. Finally, I copy the file. So while this approach does work for Docker containers, it adds some ergonomic overhead for the user making it inconvenient to use. Thanks, Sean From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 17 12:58:22 2024 Received: (at 69085) by debbugs.gnu.org; 17 Feb 2024 17:58:22 +0000 Received: from localhost ([127.0.0.1]:33819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbOxB-0007Hy-LH for submit@debbugs.gnu.org; Sat, 17 Feb 2024 12:58:22 -0500 Received: from mout.gmx.net ([212.227.15.18]:48013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbOx9-0007Hi-9r for 69085@debbugs.gnu.org; Sat, 17 Feb 2024 12:58:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708192672; x=1708797472; i=michael.albinus@gmx.de; bh=LiFqWCOwc15trYoELzHzR2QFyYxQrQywsNjL8Nw8kNM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=K37NhdU30d8JXxsaERPZdLho+zbMBmn971uUgn84+mhzvaInUFXdhiTEmCEL4jik 7kAUs99Pnt7Mko237RliO19y6mH8VE+OMQoivJRD5TzEvRNPL7XEV3hEMmGMoeO0K mgocBtHfWZrQPFTHKLIh6qDSavR3ZTEYNzGtvqwzQtRRzAL4r2xOltP9jSzqu0rsA +YhQr/EWbxvYaPAmP8r75xcpc3/A6kHG5GvUe7geQ0vD8sxDgGtetcOfgJO1U0BBB S4FO25Q/2IK4XCfDQl6FXkuDmYl40F565qBrrzlXyqev8TPyuWHvS82iPrYOzLbVW vFnXqH9o+gM8MBnDLw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MiacH-1qzZh90uqV-00fhOP; Sat, 17 Feb 2024 18:57:52 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods In-Reply-To: <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> (Sean Devlin's message of "Fri, 16 Feb 2024 12:51:17 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> <87eddctq6a.fsf@gmx.de> <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> Date: Sat, 17 Feb 2024 18:57:51 +0100 Message-ID: <87bk8fug68.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:/KAVvRM1pz/JVwjMkHEdV8+73sVPYm398k2ptBh25CtREkIWhV4 VDcUBa17fj0fMlGHLMTYk/FPCI0D4YyoDpinx62uz+dgMMWZo1q8liOJQpcXixK5CgJMebi dZa97bX0IAj8Pem88xkGj3nwXVo1Gi57DAMR4AZ54Z7+tLSuxRfeIZgsePTPhRvdHOhYnL6 pDOQCBmLxXuPEy6wnmyzA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:3LO0/xnysKs=;DTJm3nlJJUZKofs9cn/F8QlNeol ljHQvF3zCuWlyRgoiongM+km64+QAQjOADkTrskx2gV3vTK1pRMXZdg9OHgzJMQvD7FyEhedO EmKWMJFA6hinP33oPpilp2R1xNssH9ExTuYIW9yv/RBH0hYRW6iCFXjkezpoXNKl8LkSqSUIX 49ZKeSXnMvOhNglnhaGQregcTT3OV0vz7gmGAs7lwnD7ZDp8KFfbTo5P/bjDby5DWF71yRXrF NMFxppyN76o88duQn9zWA2199IkyokqqavWXpJtmjB5B1o3u/NAr/Pv+C/nIJ9lx3hQv+Fj+t Qoh9KOA71nDy99BdfV/Ap2vBDlXCVwub7ipgFxe9F8cBzpJNSuNJxZrpo/2hl87fWF6p74oYZ kWHGT2+DAMnrATjjX/MC6Mz0tghJr66y25V7fOYSutPfdsRp2H+MDq/y+RZbs5aB0R1qMiNl8 8ThbLAcJt4z/JhLQCmPM62iFayp3a0L0nIBbEmYUk61Cy7WifXD1PsU5NdGLIxDubA3W4RbXP 5pX6HJcFoYysWbv4uuaubmgxR5mfdu3996cpP7aq2hHHpcUC9+Tjxfhm0HbdAAhhPqjRno+nc tJmUFGxMvWLAwz0qb3Gb8fNePfn3g4RXZdr4uhDxzf/zdWQiXWuGr4hO/BeJm5/CPPVI4PFSK rBn3jBB2jIwRXmjrRk56HafCgSTCYKIV/oPgHgbLufEBJbjqYNYUrSctMNAEkQU+oyzzcr1tX +9TTz4YqfdR+NnNwhwZnBe6oj8Cm8vS3pUyCtZKf6NcC00JvHRvi1IyKJ0rGtuOS08ZX96bwo Eo/0FivR73bp2vLV5QoHZxc6JcZzAov4JLfQRroiWZAYj1QFWEZLjqhKLrN+Mc4Ci8 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sean Devlin writes: > Hi Michael, Hi Sean, > The patch does work as described, but it doesn=E2=80=99t integrate well w= ith typical > workflows. > > So while this approach does work for Docker containers, it adds some > ergonomic overhead for the user making it inconvenient to use. I see your point. Appended is a new patch, which addresses your inconvenience. Could you pls apply it on top of Tramp 2.7 instead of the other patch? The method "dockercp" allows now user names, which are ignored when calling "docker cp ...". > Thanks, > > Sean Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/tramp-container.el b/lisp/tramp-container.el index 1f578949..ff2e11b5 100644 =2D-- a/lisp/tramp-container.el +++ b/lisp/tramp-container.el @@ -31,15 +31,20 @@ ;; Open a file on a running Docker container: ;; ;; C-x C-f /docker:USER@CONTAINER:/path/to/file +;; C-x C-f /dockercp:USER@CONTAINER:/path/to/file ;; ;; or Podman: ;; ;; C-x C-f /podman:USER@CONTAINER:/path/to/file +;; C-x C-f /podmancp:USER@CONTAINER:/path/to/file ;; ;; Where: ;; USER is the user on the container to connect as (optional= ). ;; CONTAINER is the container to connect to. ;; +;; "docker" and "podman" are inline methods, "dockercp" and "podmancp" +;; are out-of-band methods. +;; ;; ;; ;; Open file in a Kubernetes container: @@ -141,10 +146,20 @@ If it is nil, the default context will be used." (defconst tramp-docker-method "docker" "Tramp method name to use to connect to Docker containers.") +;;;###tramp-autoload +(defconst tramp-dockercp-method "dockercp" + "Tramp method name to use to connect to Docker containers. +This is for out-of-band connections.") + ;;;###tramp-autoload (defconst tramp-podman-method "podman" "Tramp method name to use to connect to Podman containers.") +;;;###tramp-autoload +(defconst tramp-podmancp-method "podmancp" + "Tramp method name to use to connect to Podman containers. +This is for out-of-band connections.") + ;;;###tramp-autoload (defconst tramp-kubernetes-method "kubernetes" "Tramp method name to use to connect to Kubernetes containers.") @@ -183,7 +198,8 @@ BODY is the backend specific code." (defun tramp-container--completion-function (method) "List running containers available for connection. METHOD is the Tramp method to be used for \"ps\", either -`tramp-docker-method' or `tramp-podman-method'. +`tramp-docker-method', `tramp-dockercp-method', `tramp-podman-method', +or `tramp-podmancp-method'. This function is used by `tramp-set-completion-function', please see its function help for a description of the format." @@ -375,6 +391,22 @@ see its function help for a description of the format= ." (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-i" "-c")))) + (add-to-list 'tramp-methods + `(,tramp-dockercp-method + (tramp-login-program ,tramp-docker-program) + (tramp-login-args (("exec") + ("-it") + ("-u" "%u") + ("%h") + ("%l"))) + (tramp-direct-async (,tramp-default-remote-shell "-c")) + (tramp-remote-shell ,tramp-default-remote-shell) + (tramp-remote-shell-login ("-l")) + (tramp-remote-shell-args ("-i" "-c")) + (tramp-copy-program ,tramp-docker-program) + (tramp-copy-args (("cp"))) + (tramp-copy-file-name (("%h" ":") ("%f"))))) + (add-to-list 'tramp-methods `(,tramp-podman-method (tramp-login-program ,tramp-podman-program) @@ -388,6 +420,22 @@ see its function help for a description of the format= ." (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-i" "-c")))) + (add-to-list 'tramp-methods + `(,tramp-podmancp-method + (tramp-login-program ,tramp-podman-program) + (tramp-login-args (("exec") + ("-it") + ("-u" "%u") + ("%h") + ("%l"))) + (tramp-direct-async (,tramp-default-remote-shell "-c")) + (tramp-remote-shell ,tramp-default-remote-shell) + (tramp-remote-shell-login ("-l")) + (tramp-remote-shell-args ("-i" "-c")) + (tramp-copy-program ,tramp-podman-program) + (tramp-copy-args (("cp"))) + (tramp-copy-file-name (("%h" ":") ("%f"))))) + (add-to-list 'tramp-methods `(,tramp-kubernetes-method (tramp-login-program ,tramp-kubernetes-program) @@ -431,10 +479,18 @@ see its function help for a description of the forma= t." tramp-docker-method `((tramp-container--completion-function ,tramp-docker-method))) + (tramp-set-completion-function + tramp-dockercp-method + `((tramp-container--completion-function ,tramp-dockercp-method))) + (tramp-set-completion-function tramp-podman-method `((tramp-container--completion-function ,tramp-podman-method))) + (tramp-set-completion-function + tramp-podmancp-method + `((tramp-container--completion-function ,tramp-podmancp-method))) + (tramp-set-completion-function tramp-kubernetes-method `((tramp-kubernetes--completion-function ,tramp-kubernetes-method))) diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index 3557b3a1..b3ab5609 100644 =2D-- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -282,6 +282,7 @@ The string is used in `tramp-methods'.") (tramp-copy-program "nc") ;; We use "-v" for better error tracking. (tramp-copy-args (("-w" "1") ("-v") ("%h") ("%= r"))) + (tramp-copy-file-name (("%f"))) (tramp-remote-copy-program "nc") ;; We use "-p" as required for newer busyboxes. For olde= r ;; busybox/nc versions, the value must be (("-l") ("%r"))= . This @@ -2399,10 +2400,10 @@ The method used must be an out-of-band method." #'file-name-as-directory #'identity) (if v1 - (tramp-make-copy-program-file-name v1) + (tramp-make-copy-file-name v1) (file-name-unquote filename))) target (if v2 - (tramp-make-copy-program-file-name v2) + (tramp-make-copy-file-name v2) (file-name-unquote newname))) ;; Check for listener port. @@ -5559,13 +5560,17 @@ raises an error." string "")) -(defun tramp-make-copy-program-file-name (vec) +(defun tramp-make-copy-file-name (vec) "Create a file name suitable for `scp', `pscp', or `nc' and workalikes.= " (let ((method (tramp-file-name-method vec)) (user (tramp-file-name-user vec)) (host (tramp-file-name-host vec)) (localname (directory-file-name (tramp-file-name-unquote-localname vec)))) + ;; Set the default value of connection property "copy-file-name". + (unless (tramp-get-method-parameter vec 'tramp-copy-file-name) + (tramp-set-connection-property + vec "copy-file-name" '(("%u" "@") ("%h" ":") ("%f")))) (when (string-match-p tramp-ipv6-regexp host) (setq host (format "[%s]" host))) ;; This does not work for MS Windows scp, if there are characters @@ -5573,11 +5578,10 @@ raises an error." ;; checking in scp, we use it when available. (unless (string-match-p (rx "ftp" eos) method) (setq localname (tramp-unquote-shell-quote-argument localname))) - (cond - ((tramp-get-method-parameter vec 'tramp-remote-copy-program) - localname) - ((tramp-string-empty-or-nil-p user) (format "%s:%s" host localname)) - (t (format "%s@%s:%s" user host localname))))) + (string-join + (apply #'tramp-expand-args vec 'tramp-copy-file-name + (list ?h (or host "") ?u (or user "") ?f localname)) + ""))) (defun tramp-method-out-of-band-p (vec size) "Return t if this is an out-of-band method, nil otherwise." diff --git a/lisp/tramp.el b/lisp/tramp.el index 2efee234..0e64b779 100644 =2D-- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -301,6 +301,14 @@ pair of the form (KEY VALUE). The following KEYs are= defined: This specifies the list of parameters to pass to the above mentioned program, the hints for `tramp-login-args' also apply here. + * `tramp-copy-file-name' + The remote source or destination file name for out-of-band methods. + You can use the \"%u\" and \"%h\" like in `tramp-login-args'. + Additionally, \"%f\" denotes the local file name part. It will be + expanded to a string without spaces between the elements of the list. + + The default value is \\=3D'((\"%u\" \"@\") (\"%h\" \":\") (\"%f\")) + * `tramp-copy-env' A list of environment variables and their values, which will be set when calling `tramp-copy-program'. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 19 14:20:58 2024 Received: (at 69085) by debbugs.gnu.org; 19 Feb 2024 19:20:58 +0000 Received: from localhost ([127.0.0.1]:43435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rc9CE-0007RO-Bb for submit@debbugs.gnu.org; Mon, 19 Feb 2024 14:20:58 -0500 Received: from mail-oa1-f41.google.com ([209.85.160.41]:57664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rc9C9-0007R8-Mn for 69085@debbugs.gnu.org; Mon, 19 Feb 2024 14:20:57 -0500 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-2196dd318f5so3206881fac.3 for <69085@debbugs.gnu.org>; Mon, 19 Feb 2024 11:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1708370366; x=1708975166; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LinUNJD0MOQSVSnv/Y1QkvxoiBGZqGO1Mxaaj52OnYA=; b=Flun0w7KMcK3i4crH3YjZEjxI1NWVsfxlv+hLE8q4QauipCTbFTInoVUhqafnMsJo1 dSzLHX0QYfaZy82xk4y4SV5kRm4+Sh83aBmz6hd6GYW0Enr1hSk5xyQygFGqpcxM88mN 0fhE8BcU/c/kpdGxKwXCbxxvibwUle+jp7wx/80u/wCTmI9gZ07OpUOQCa8hVFvJnTZv nThCjAxbEM0Ke1cqBXtMtxd6e8bz0q4Gow1n2AF93kSYWyzut8iBEUgxSHo5bgklsdFX Kr0DNl79amQvkja5Za8kh4gO6H6l20Sk9/4LLnNlfTsRI1ArGiutI/3CYx4Kyc7NRmkP 0AIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708370366; x=1708975166; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LinUNJD0MOQSVSnv/Y1QkvxoiBGZqGO1Mxaaj52OnYA=; b=YkJ06WNIKi3IjJ3WFbEf9+TkdL0k/3T5VJT9sttq/cFjQ4aEnT2+ExUD5Xr8BvRbsU VyFnQgcr3B8jgS9TGLX9m2rQZ6pjmeJtj8yZ4k3rTOZgPxkL9lk/m1fREkcIF4O/KcPE jmv6XZfO6Tf8ygWOth+zgdpTcFQvTO/ce1nYEuW7FQI33tzLhpi+7F+ErlzMgkNxsLKG MtqUONn17JmOFGDR48bUKEoQu/CIzPZuYGJmMuKMmpvIqNoKZayTdCGD5PGEkYhjk4Kp cQXyDwrDHbWCmZZyYhrycQBU72FRRVAD9171T8HcQI/DMgeSJwObOLhev9IngpIgNf1O a0+Q== X-Gm-Message-State: AOJu0YzwEYXVyKg17kDmjAjRLpROxY1qe5hxXPzYAyXQJcAkNRo+BIpl thmIHSYM9nHTwX4YYsb0KoxF8yX2+wui0/PlEXQ/wrLGoj09keVEdabRN0jPwQs= X-Google-Smtp-Source: AGHT+IFfWpBgA4l3vIv6XyUXtvk9lKaVqBG45/hhDPjmlnMr1/27IDOqQm0ij0jEBM+fP7DCqqiuxQ== X-Received: by 2002:a05:6870:1f0d:b0:21e:95d9:dc7b with SMTP id pd13-20020a0568701f0d00b0021e95d9dc7bmr7953324oab.30.1708370366668; Mon, 19 Feb 2024 11:19:26 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id g5-20020a0cf845000000b0068ee3a50585sm3535745qvo.38.2024.02.19.11.19.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2024 11:19:26 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods From: Sean Devlin In-Reply-To: <87bk8fug68.fsf@gmx.de> Date: Mon, 19 Feb 2024 14:19:19 -0500 Content-Transfer-Encoding: 7bit Message-Id: <4783F0CB-915A-465E-9F6B-E0E5A9934B8F@toadstyle.org> References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> <87eddctq6a.fsf@gmx.de> <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> <87bk8fug68.fsf@gmx.de> To: Michael Albinus X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 69085 Cc: 69085@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Hi Michael, > I see your point. Appended is a new patch, which addresses your > inconvenience. Could you pls apply it on top of Tramp 2.7 instead of the > other patch? The method "dockercp" allows now user names, which are > ignored when calling "docker cp ...". This works perfectly! I see no issues with this patch. Thanks for spending so much time on this, I really appreciate your help! Sean From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 07:04:34 2024 Received: (at 69085-done) by debbugs.gnu.org; 20 Feb 2024 12:04:34 +0000 Received: from localhost ([127.0.0.1]:44446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcOrS-0004NC-ED for submit@debbugs.gnu.org; Tue, 20 Feb 2024 07:04:34 -0500 Received: from mout.gmx.net ([212.227.15.18]:52867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcOrO-0004Mx-8Q for 69085-done@debbugs.gnu.org; Tue, 20 Feb 2024 07:04:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1708430642; x=1709035442; i=michael.albinus@gmx.de; bh=E0dbbrFr4xFI04IlqCQXGCq7+D72wZriuBRf8si7RAQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=g3qh1RFcj3I1s53bN7rUxyMq6AVlbTKZy7UV1BA8GozXNtWHg7YvsfUKGw5GD3Ok ucY9aQ4Pqvgvs2QgQpc24UKNlLiFBzSnuGv7faC6xDM9F70SABO2e7cCve1A5Mig9 8cnoJapMze3Sv1tVxGVseoq15t8Jq1wZBmYQ51ZL7sfdW1arsJAfRC2m9v4kJ71MS fkPtUvHillTL5dMJbDwGPPbOVRFTjx1b9T2Orgi9yb0HAl2IQ98H64gE6MELFNb7c daavY8GiqgMRZaFAXEgBKCjsWHmFHalOR1i3K3pwPZzxQgKc9Su7Wwl/gdv6SU00q 3wnxoVrjtxcnSEFhmA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MwfWa-1qjsYV493S-00yC9d; Tue, 20 Feb 2024 13:04:02 +0100 From: Michael Albinus To: Sean Devlin Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods In-Reply-To: <4783F0CB-915A-465E-9F6B-E0E5A9934B8F@toadstyle.org> (Sean Devlin's message of "Mon, 19 Feb 2024 14:19:19 -0500") References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> <87eddctq6a.fsf@gmx.de> <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> <87bk8fug68.fsf@gmx.de> <4783F0CB-915A-465E-9F6B-E0E5A9934B8F@toadstyle.org> Date: Tue, 20 Feb 2024 13:04:00 +0100 Message-ID: <877ciztk9b.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:O+7ZZKOWWXkdBiO8hKBl4aISrdKW9OgBZCLh/ZTuHqJxKf45RMp 0rfz/F3vdzblgAsfFcQQNizeem6cXebbcE9LHghNSvjw1asmnBkwloHfzyh6suarlBxgWNW nrIIuzudpAO35QTz+cS9WDhkki2ocVDXgn/oylyJl0t9yjSblvRXbI9gOV0FliV+xGy8WVY 3NplumZI26It+aij9LiQw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:biIXyx6zkZs=;nmA/NY6205qeM1pl5XuygpUbzfb GA8ReTnI/OFL5EOi1qvcq0WWnN+AqsYY5Lq/ZO90W+V/ULR5zZ7vvC1rmqhQ1ZXw8ZyoJyf0a M80A3Ap6YsfxDw3gEb9NRTvHXJoj88mmmccyv3itax1Tk2CdnUK+om/c5UsSWY4+oo6dRQnOP PK6uNOtVb9ue4fGLoogbmhCUrexAytM6GVhC9iTU52cR/FhXG/vFA0uYTCWSPhgAGfpNuo+Mp rAI8Q98I6EGHROx9gnTTbqKqGpwJNMftXImbZSjcevo/dNyaVOh+jqSsnBEnGAmxWuDAxdlpM xs+ZGuIdVbvfhoEo6+yBqN209SDNw35mrxEQItD2BStKBQOsZwF7fK3PTkgrufa6QBU4g0Mj3 oJ/8a1S04VEW0PLtiXTz5UPHuESkJb3WUwwZPTMDJNhvaougEhPANrWBLvKjlosf5TmCCb7wH 0FwKzCW+6f73l66KRtk/auGSq24Rh7jYItheEZmSRlbwCb3J81qGJEbp9fOdJZbugfgD33hcK C8uhlshSPKUq/f9PL+jGI+o0M7xjXyDrKCJyHDYme+LjViCsDD4xPxlbOoNpW8c4sVkd7stZ9 wLcTqc8pO9ZndF7x8HwmZ9e/NY6hPC5uM+mkOLb92mCjNQWGqOVWQGrp3sExguDdacyi9AeEf SU+c4oYyxVwYqzZQEgiL5A+fnj1RQPV+kbjV9ov6JvI2SqjGJVA5QDCJOdDNa1XFe2NJ4Veqf Z/91Zyor9WOj+ihlRnsulbSx9HfawkK02qW85NQ1f8eIuagW4qfikkBbtLDbtWTXegiT+FgFq 3BsLUstku9M/m8vFU9yiqzH/851MQJleDshay2ZKwNv8TwPl3F156IX0NwsdYebrYH X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 69085-done Cc: 69085-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Version: 30.1 Sean Devlin writes: > Hi Michael, Hi Sean, >> I see your point. Appended is a new patch, which addresses your >> inconvenience. Could you pls apply it on top of Tramp 2.7 instead of the >> other patch? The method "dockercp" allows now user names, which are >> ignored when calling "docker cp ...". > > This works perfectly! I see no issues with this patch. Thanks for the feedback. Over the weekend, I ran Tramp regression tests. There were still some minor annoyances with the new methods, but that's fixed now. I've pushed an extended version of the patch to the repositories. Will be available with Tramp 2.7.1 and Emacs 30.1. Closing the bug. > Thanks for spending so much time on this, I really appreciate your help! > > Sean Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 11:17:31 2024 Received: (at 69085-done) by debbugs.gnu.org; 20 Feb 2024 16:17:31 +0000 Received: from localhost ([127.0.0.1]:46414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcSoF-0005cD-6B for submit@debbugs.gnu.org; Tue, 20 Feb 2024 11:17:31 -0500 Received: from mail-qk1-f170.google.com ([209.85.222.170]:54511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcSoD-0005by-C2 for 69085-done@debbugs.gnu.org; Tue, 20 Feb 2024 11:17:30 -0500 Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-785d954b236so339907685a.0 for <69085-done@debbugs.gnu.org>; Tue, 20 Feb 2024 08:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1708445762; x=1709050562; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7FzRuxdvUeblE3adtUL0KkBkm6GXYaDsLZT0ueMxyIo=; b=FgC5ngFxghLg/qOL141Trw7t474Hyn+5g9fnydn//XiIJHmEQSMEgXNmA+yuKt8FK1 OWwcsUExlpcXZmqG4v0vrR4lBiTi2h0YV99htzwKqbOeBoXXw1x7tyADEadULJGrVvlV A+0pSEKVp8S+W6SK/14+8A3v6Vj6wDf4Obzx7vkJhykeLujpHQw4wHgfeDXZGFy80AS0 X3swnzA6/PzpOiiccSNcTa3daLNPx1nfmJsPrJWChikhSe/w2AhfVcMhdPgvnxE6v4bC bCzwEIl6/4ajRpAVdPfcobkg1bEBg1fzMAzU3I1bn115M2FpOD77STJRxQV2jHkbvy95 JFgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708445762; x=1709050562; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7FzRuxdvUeblE3adtUL0KkBkm6GXYaDsLZT0ueMxyIo=; b=BGSWCzVCRYwxEdmg/l50p7p2kPuB0j4k7hhgl1nADkQ5R2lhwVdgY+ru9ULeGy52/G 1vevT0a38W99h+rpCnc9PHAzgtw7zdQIlOQoBV+2h1bUKHH89elcvWKFlky5jdOPT7cs 99LbmXtr50PV67CCcAzS5rYnK7k8xnVdogRoCwy/4wFsRM9DjNtcPHHcasAkuc/kHKCh RvryTURt7Bm3i6jKgctyFF8sGZs2o9k6dd/q35S9d6ixR0wffAQHYW3Cg/J6JCR0YCBX +RQb+nIaYWqzx1zkYS9L8G3eQEa6SsJ/y2GP54jbUt/Wn/3SV0f/K7Fn+sdxIQfB58nC U1fg== X-Gm-Message-State: AOJu0YwQFBXYd7kZ4TYHfYhYpxYbWsWA56Xery5zbU26ZVLJ6KaUDlYl nOmnIyOkgmbXc5FpMJ2WuRwLwS4sWhlPgJ/abhS3SZngaqzp21O6sPrxki2vIro= X-Google-Smtp-Source: AGHT+IFF3mT1u+l8dZ/2zsGIvKKLc2Iiz4I3XhZvPIuBL1Dy7nCdSIviREzvqX18PWTEhIIYt+9RWg== X-Received: by 2002:a05:620a:2157:b0:785:d44f:16f3 with SMTP id m23-20020a05620a215700b00785d44f16f3mr16675165qkm.42.1708445761848; Tue, 20 Feb 2024 08:16:01 -0800 (PST) Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id q5-20020a05620a038500b007861bea2972sm3498248qkm.6.2024.02.20.08.16.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2024 08:16:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Subject: Re: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods From: Sean Devlin In-Reply-To: <877ciztk9b.fsf@gmx.de> Date: Tue, 20 Feb 2024 11:15:50 -0500 Content-Transfer-Encoding: 7bit Message-Id: References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> <87eddctq6a.fsf@gmx.de> <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> <87bk8fug68.fsf@gmx.de> <4783F0CB-915A-465E-9F6B-E0E5A9934B8F@toadstyle.org> <877ciztk9b.fsf@gmx.de> To: Michael Albinus X-Mailer: Apple Mail (2.3774.500.141) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 69085-done Cc: 69085-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Hi Michael, > Thanks for the feedback. > > Over the weekend, I ran Tramp regression tests. There were still some > minor annoyances with the new methods, but that's fixed now. > > I've pushed an extended version of the patch to the repositories. Will > be available with Tramp 2.7.1 and Emacs 30.1. > > Closing the bug. Sounds good. Thanks again for your help with this. Sean From unknown Sat Sep 20 05:02:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 20 Mar 2024 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator