From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61326: Adding --no-add-suffix to zip patch Date: Wed, 08 Feb 2023 09:21:11 +0800 Message-ID: References: <87ilgeoc4w.fsf@tullinup.koldfront.dk> <8574C128-9560-490A-88E6-49E415BBDB24@netyu.xyz> <87ilgdjlga.fsf@tullinup.koldfront.dk> Reply-To: Ruijie Yu Mime-Version: 1.0 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="3020"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.13; emacs 29.0.60 Cc: 61326@debbugs.gnu.org To: Adam =?UTF-8?Q?Sj=C3=B8gren?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 08 02:32:17 2023 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 1pPZJo-0000Xp-Rq for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Feb 2023 02:32:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPZJc-0001q0-U8; Tue, 07 Feb 2023 20:32:05 -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 1pPZJb-0001pJ-2T for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 20:32:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPZJa-0005Oj-QC for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 20:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pPZJa-0003tz-7A for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 20:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Feb 2023 01:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61326 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, 61326@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167581990114967 (code B ref -1); Wed, 08 Feb 2023 01:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Feb 2023 01:31:41 +0000 Original-Received: from localhost ([127.0.0.1]:54318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPZJE-0003tL-Uy for submit@debbugs.gnu.org; Tue, 07 Feb 2023 20:31:41 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:50988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPZJC-0003tC-O3 for submit@debbugs.gnu.org; Tue, 07 Feb 2023 20:31:39 -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 1pPZJ8-0001fk-EL for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 20:31:34 -0500 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPZJ5-0005KI-I2 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 20:31:32 -0500 Original-Received: from fw.net.yu.netyu.xyz ( [36.249.106.224]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 00d5da1a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 8 Feb 2023 01:31:26 +0000 (UTC) In-reply-to: <87ilgdjlga.fsf@tullinup.koldfront.dk> Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:255091 Archived-At: Adam Sj=C3=B8gren via "Bug reports for GNU Emacs, the Swiss army knife of t= ext editors" writes: > Ruijie writes: > >> Maybe, at least in the meantime, we change it such that all write >> operations for zip create files in temp, and move to / overwrite the >> original file when done? Although I don=E2=80=99t have a full understand= ing on >> how that would be done and whether there are problems along with it. > > That sounds like a good solution, for archives with no '.' in the filenam= e. > > I guess the main problem is if the archive is huge, updating an existing > archive might (?) be more efficient than creating an entirely new one. > > Another way to go about it could be to temporarily rename the archive to > have a name with a '.' in it, make the change, and then rename it back; > conceptually: > > mv a a.zip > # update a.zip rather than a > mv a.zip a > > That has its own set of possible problems. > > Maybe you could make a link to the original archive, where the link has > a '.' in the name, have zip update the file via the link and then remove > the link again; conceptually: > > ln a a.zip > # update a.zip rather than a > rm a.zip > > I think I like this the most, but again... I like the link solution, but I don't think we can reliably "link" without knowing that we actually can do so -- i.e., on MS Windows, IIUC, one needs admin privilege to create symlinks on cmd unless something in the registry is changed. Also, on old MS Windows versions like XP and earier, I believe it is impossible to create symlinks at all. (Do we still support them?) Come to think of it, I think your mv idea might be better and even easier to implement than my zip-offsite-then-overwrite idea. I might lean towards that method if people have no bias when I work on the patch in a couple hours. Best, RY