From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Devlin Newsgroups: gmane.emacs.bugs Subject: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods Date: Tue, 13 Feb 2024 15:18:08 -0500 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> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5432"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69085@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 13 21:20:09 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rZzGC-0001CD-9L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Feb 2024 21:20:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZzFq-00040i-TW; Tue, 13 Feb 2024 15:19:47 -0500 Original-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 1rZzFp-00040X-17 for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 15:19:45 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZzFo-00057b-Ot for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 15:19:44 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZzG5-0005r4-QT for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 15:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Feb 2024 20:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69085 X-GNU-PR-Package: emacs Original-Received: via spool by 69085-submit@debbugs.gnu.org id=B69085.170785558522476 (code B ref 69085); Tue, 13 Feb 2024 20:20:01 +0000 Original-Received: (at 69085) by debbugs.gnu.org; 13 Feb 2024 20:19:45 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <8734twimm3.fsf@gmx.de> X-Mailer: Apple Mail (2.3774.500.141) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279980 Archived-At: 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.