GNU bug report logs - #61326
30.0.50; Editing fil in zip file without extension save creates new file

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Adam Sjøgren <asjo@HIDDEN>; dated Mon, 6 Feb 2023 17:01:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 7 Feb 2023 19:59:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 07 14:59:40 2023
Received: from localhost ([127.0.0.1]:54126 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pPU7w-0006qv-8C
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2023 14:59:40 -0500
Received: from virgil.koldfront.dk ([212.237.178.116]:44422)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <asjo@HIDDEN>) id 1pPU7t-0006qj-W7
 for 61326 <at> debbugs.gnu.org; Tue, 07 Feb 2023 14:59:38 -0500
Received: from tullinup.koldfront.dk (tullinup.koldfront.dk [192.168.1.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by virgil.koldfront.dk (Postfix) with ESMTPS id C6FBE16BCC903
 for <61326 <at> debbugs.gnu.org>; Tue,  7 Feb 2023 20:59:33 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.11.0 virgil.koldfront.dk C6FBE16BCC903
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koldfront.dk;
 s=mail; t=1675799973;
 bh=mHNwEmqr11b+iw3T+auHLjeKS7rtgk/n8it76ckLYc4=;
 h=From:To:Subject:In-Reply-To:References:Date:From;
 b=j/9/x/RYxgTckOh2T47Gu0C+KWrWlllF9C1wfyEzPnnwDoGN84sisBJJtGbCRl3jy
 pRfiwvPofEzHLYZdhh67fyQ03/F+aVb6BNMz6vqJoB2SBCrmvXSOO3VQIzVzQCyIKH
 50nJaABM6XjignRgDYgqIxUdaGLYCoBZSX9xdPOYEhwCwtxGm9sErjPToBfaSzH0pf
 N7yaPA0NXIYQgCgdHRwSbCuwuZNoejRBIYMRAMu3yfz61NWfJQyRMz44JFcmFpWTgq
 sQUNKbzjY7DXVmVmBZhrSaSsZhEROR82VT6fYQCUN4SGMo1NyKraLwltHQJy4BjxIv
 iZUIqV18TyAfw==
Received: by tullinup.koldfront.dk (Postfix, from userid 1000)
 id B176420196C92; Tue,  7 Feb 2023 20:59:33 +0100 (CET)
From: =?utf-8?Q?Adam_Sj=C3=B8gren?= <asjo@HIDDEN>
To: 61326 <at> debbugs.gnu.org
Subject: Re: bug#61326: Adding --no-add-suffix to zip patch
In-Reply-To: <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN> (Ruijie Yu's
 message of "Tue, 7 Feb 2023 09:31:11 +0800")
Organization: koldfront - analysis & revolution, Copenhagen, Denmark
References: <87ilgeoc4w.fsf@HIDDEN>
 <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN>
OpenPGP: id=476630590A231909B0A0961A49D0746121BDE416;
 url=https://asjo.koldfront.dk/gpg.asc
X-Now-Playing: The Real Snow White, 4:13 Dream (The Cure)
X-Hashcash: 1:25:230207:ruijie@HIDDEN::j0quCQBs7pLHCCx+:0nbxX
X-Hashcash: 1:25:230207:61326 <at> debbugs.gnu.org::MHyT4/JDBk/xavg2:0Hgqf
X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,
 Q(^@xk}n4Ou
 rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ
 ^St'=VZBR<gm`!Dj`dIpp?+$"$l_'JKDN\w-jB;fo0Qy}Tbw
Date: Tue, 07 Feb 2023 20:59:33 +0100
Message-ID: <87ilgdjlga.fsf@HIDDEN>
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-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 61326
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

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 understandi=
ng 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 filename.

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...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 7 Feb 2023 14:54:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 07 09:54:14 2023
Received: from localhost ([127.0.0.1]:51653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pPPML-000402-Vn
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2023 09:54:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:44184)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pPPMK-0003zq-1P
 for 61326 <at> debbugs.gnu.org; Tue, 07 Feb 2023 09:54:12 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pPPMD-0004Xy-Nt; Tue, 07 Feb 2023 09:54:05 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=UZ96IQ+YGGpvaceGv74a5wG0CZdz6+EV7qCrDeh/VLQ=; b=iy9L7vJWsfYuX6wLX9jS
 Qf2pUl8vADgJhdJ7Lac/S9h5COGSTxeWtaU0fsXRuzTSqTnFFgJH5RySPrwH7ytKkUB1Mpda0uyxm
 5DnQ/zQR9O8VDK/iTBsNRC35wV3mu9OMOgw5RBO3LFPa+O5mfj3MXn6Oc7HifPUOoLVLZej9PHqyH
 qGDp0BJzT+UiBgm1SPUbZLsjDz4J9D2B4im3ZRChW8Eu/8Y6/jhfg7yM664d9Ku0iJDiP824EHxjQ
 e3/Gw8VQeiLv1SsM/5o3udCYDS2pnEvCjSQdy5E6RkKe54URi/hOZEcyNB7huWtJ3J5EcvK74SVw+
 GnF8nrv6IqksXw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pPPMD-0000ds-7l; Tue, 07 Feb 2023 09:54:05 -0500
Date: Tue, 07 Feb 2023 16:54:21 +0200
Message-Id: <834jrxpluq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ruijie Yu <ruijie@HIDDEN>
In-Reply-To: <sdv4jrxeeq3.fsf@HIDDEN> (message from Ruijie Yu on Tue, 07
 Feb 2023 21:53:12 +0800)
Subject: Re: bug#61326: Adding --no-add-suffix to zip patch
References: <87ilgeoc4w.fsf@HIDDEN>
 <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN> <83k00up32i.fsf@HIDDEN>
 <sdv4jrxeeq3.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61326
Cc: asjo@HIDDEN, 61326 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Ruijie Yu <ruijie@HIDDEN>
> Cc: asjo@HIDDEN, 61326 <at> debbugs.gnu.org
> Date: Tue, 07 Feb 2023 21:53:12 +0800
> 
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Cc: 61326 <at> debbugs.gnu.org
> >> Date: Tue, 7 Feb 2023 09:31:11 +0800
> >> From:  Ruijie Yu via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> >>
> >> 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’t have a full understanding on how that would be done and
> >> whether there are problems along with it.
> >
> > How about submitting a patch to do that, but only when the original
> > file doesn't have an extension?
> 
> Will do.  Will report back in 2-3 days unless someone else gets to it
> first.

Thanks in advance.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 7 Feb 2023 14:23:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 07 09:23:59 2023
Received: from localhost ([127.0.0.1]:51608 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pPOt5-0003Du-Ab
	for submit <at> debbugs.gnu.org; Tue, 07 Feb 2023 09:23:59 -0500
Received: from netyu.xyz ([152.44.41.246]:38744 helo=mail.netyu.xyz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1pPOt3-0003Dk-E6
 for 61326 <at> debbugs.gnu.org; Tue, 07 Feb 2023 09:23:57 -0500
Received: from fw.net.yu.netyu.xyz (<unknown> [36.249.106.224])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id 1c91d5dc
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Tue, 7 Feb 2023 14:23:55 +0000 (UTC)
References: <87ilgeoc4w.fsf@HIDDEN>
 <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN> <83k00up32i.fsf@HIDDEN>
User-agent: mu4e 1.8.13; emacs 29.0.60
From: Ruijie Yu <ruijie@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#61326: Adding --no-add-suffix to zip patch
Date: Tue, 07 Feb 2023 21:53:12 +0800
In-reply-to: <83k00up32i.fsf@HIDDEN>
Message-ID: <sdv4jrxeeq3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 61326
Cc: asjo@HIDDEN, 61326 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)


Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: 61326 <at> debbugs.gnu.org
>> Date: Tue, 7 Feb 2023 09:31:11 +0800
>> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>>
>> Maybe, at least in the meantime, we change it such that all write operat=
ions
>> for zip create files in temp, and move to / overwrite the original file =
when
>> done? Although I don=E2=80=99t have a full understanding on how that wou=
ld be done and
>> whether there are problems along with it.
>
> How about submitting a patch to do that, but only when the original
> file doesn't have an extension?

Will do.  Will report back in 2-3 days unless someone else gets to it
first.

Best,


RY




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 7 Feb 2023 03:27:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 06 22:27:46 2023
Received: from localhost ([127.0.0.1]:50550 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pPEe1-00078q-VU
	for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 22:27:46 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46966)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pPEe0-00078Y-P0
 for 61326 <at> debbugs.gnu.org; Mon, 06 Feb 2023 22:27:45 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pPEdt-0004P6-78; Mon, 06 Feb 2023 22:27:37 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=gicD7wLKfwcy30i98lR0xBl9F0qp9IRrIFkg3Xlj4IQ=; b=hhd7faInxdJNOI1y+Nbi
 XIiC1hAYtZsTJj13UBRH6sMMaeDHteuOojVNFOw2mq8t4tSL7ZO84VxvU+fy7iTjsyBGDrJ2JjHGa
 DRvztdDUgli2swvrN5FPsYN4REDunuUL9an/i2e11iPgO2Uqm0wtIN2IEWTOl+s1TW3SwxF33hWuV
 bvz8L8uCWRoSNE1y+aCPIWy1AX8Gvqcb0pKmFZ3124NDTvpEUlRwQMJxtN8VKrt8JcyeYE5lA1Dws
 qRs2YbrfSPll+uad5U2tqTWJ5GREJw+FpKtZJjtkwmaZy3z5AAys+coBPu64p9G9RaL6S3wQxdm41
 jvSqSN0BLfQ/pA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pPEds-0001j9-KJ; Mon, 06 Feb 2023 22:27:36 -0500
Date: Tue, 07 Feb 2023 05:27:49 +0200
Message-Id: <83k00up32i.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ruijie Yu <ruijie@HIDDEN>
In-Reply-To: <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN>
 (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#61326: Adding --no-add-suffix to zip patch
References: <87ilgeoc4w.fsf@HIDDEN>
 <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61326
Cc: asjo@HIDDEN, 61326 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 61326 <at> debbugs.gnu.org
> Date: Tue, 7 Feb 2023 09:31:11 +0800
> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 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’t have a full understanding on how that would be done and whether there are problems along with it. 

How about submitting a patch to do that, but only when the original
file doesn't have an extension?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 7 Feb 2023 01:31:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 06 20:31:53 2023
Received: from localhost ([127.0.0.1]:50493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pPCps-0003tR-VT
	for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 20:31:53 -0500
Received: from netyu.xyz ([152.44.41.246]:51552 helo=mail.netyu.xyz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1pPCpr-0003tJ-Dm
 for 61326 <at> debbugs.gnu.org; Mon, 06 Feb 2023 20:31:52 -0500
Received: from smtpclient.apple (<unknown> [36.249.106.224])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id f81ccfe2
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Tue, 7 Feb 2023 01:31:50 +0000 (UTC)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: Ruijie Yu <ruijie@HIDDEN>
Mime-Version: 1.0 (1.0)
Subject: Re: bug#61326: Adding --no-add-suffix to zip patch
Date: Tue, 7 Feb 2023 09:31:11 +0800
Message-Id: <8574C128-9560-490A-88E6-49E415BBDB24@HIDDEN>
References: <87ilgeoc4w.fsf@HIDDEN>
In-Reply-To: <87ilgeoc4w.fsf@HIDDEN>
To: =?utf-8?Q?Adam_Sj=C3=B8gren?= <asjo@HIDDEN>
X-Mailer: iPhone Mail (20D47)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 61326
Cc: 61326 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On Feb 7, 2023, at 02:58, Adam Sj=C3=B8gren via Bug reports for GNU Emacs, t=
he Swiss army knife of text editors <bug-gnu-emacs@HIDDEN> wrote:
>=20
> =EF=BB=BFAdding a '--no-add-suffix' option to zip 3.0 is not too bad:
>=20
> diff -u orig/zip-3.0/globals.c chan/zip-3.0/globals.c
> --- orig/zip-3.0/globals.c    2008-05-25 19:26:38.000000000 +0200
> +++ chan/zip-3.0/globals.c    2023-02-06 19:42:48.000000000 +0100
> @@ -106,6 +106,7 @@
> int noisy =3D 1;                /* 0=3Dquiet operation */
> int extra_fields =3D 1;         /* 0=3Dcreate minimum, 1=3Ddon't copy old,=
 2=3Dkeep old */
> int use_descriptors =3D 0;      /* 1=3Duse data descriptors 12/29/04 */
> +int no_add_suffix =3D 0;        /* 1=3Ddo not add suffix .zip to archive n=
ames without . */
> int zip_to_stdout =3D 0;        /* output zipfile to stdout 12/30/04 */
> int allow_empty_archive =3D 0;  /* if no files, create empty archive anywa=
y 12/28/05 */
> int copy_only =3D 0;            /* 1=3Dcopying archive entries only */
> diff -u orig/zip-3.0/zip.c chan/zip-3.0/zip.c
> --- orig/zip-3.0/zip.c    2023-02-06 19:49:42.000000000 +0100
> +++ chan/zip-3.0/zip.c    2023-02-06 19:47:26.000000000 +0100
> @@ -1942,6 +1942,7 @@
> #ifdef UNICODE_TEST
> #define o_sC            0x146
> #endif
> +#define o_nas           0x147
>=20
>=20
> /* the below is mainly from the old main command line
> @@ -2042,6 +2043,7 @@
>     {"N",  "notes",       o_NO_VALUE,       o_NOT_NEGATABLE, 'N',  "add no=
tes as entry comments"},
> #endif
>     {"o",  "latest-time", o_NO_VALUE,       o_NOT_NEGATABLE, 'o',  "use la=
test entry time as archive time"},
> +    {"",   "no-add-suffix", o_NO_VALUE,     o_NOT_NEGATABLE, o_nas, "do n=
ot add .zip suffix to archive name without ."},
>     {"O",  "output-file", o_REQUIRED_VALUE, o_NOT_NEGATABLE, 'O',  "set ou=
t zipfile different than in zipfile"},
>     {"p",  "paths",       o_NO_VALUE,       o_NOT_NEGATABLE, 'p',  "store p=
aths"},
>     {"P",  "password",    o_REQUIRED_VALUE, o_NOT_NEGATABLE, 'P',  "encryp=
t entries, option value is password"},
> @@ -2378,6 +2380,7 @@
>   before =3D 0;             /* 0=3Dignore, else exclude files before this t=
ime */
>   after =3D 0;              /* 0=3Dignore, else exclude files newer than t=
his time */
>=20
> +  no_add_suffix =3D 0       /* 0=3Dadd .zip if no . as usual, else use ar=
chive name unchanged */
>   special =3D ".Z:.zip:.zoo:.arc:.lzh:.arj"; /* List of special suffixes *=
/
>   key =3D NULL;             /* Scramble password if scrambling */
>   key_needed =3D 0;         /* Need scramble password */
> @@ -3299,6 +3302,11 @@
>           break;
> #endif
>=20
> +        case o_nas:
> +          no_add_suffix =3D 1;
> +          break;
> +
> +
>         case o_NON_OPTION_ARG:
>           /* not an option */
>           /* no more options as permuting */
> @@ -3340,8 +3348,14 @@
> #endif /* !MACOS && !WINDLL */
>               {
>                 /* name of zipfile */
> -                if ((zipfile =3D ziptyp(value)) =3D=3D NULL) {
> -                  ZIPERR(ZE_MEM, "was processing arguments");
> +                if (no_add_suffix) {
> +                  zipfile =3D value;
> +                }
> +                else {
> +                  if ((zipfile =3D ziptyp(value)) =3D=3D NULL) {
> +                    ZIPERR(ZE_MEM, "was processing arguments");
> +                  }
> +                  free(value);
>                 }
>                 /* read zipfile if exists */
>                 /*
> @@ -3349,7 +3363,6 @@
>                   ZIPERR(r, zipfile);
>                 }
>                 */
> -                free(value);
>               }
>               if (show_what_doing) {
>                 fprintf(mesg, "sd: Zipfile name '%s'\n", zipfile);
> diff -u orig/zip-3.0/zip.h chan/zip-3.0/zip.h
> --- orig/zip-3.0/zip.h    2008-05-25 19:23:22.000000000 +0200
> +++ chan/zip-3.0/zip.h    2023-02-06 19:43:41.000000000 +0100
> @@ -442,6 +442,7 @@
>  extern int use_privileges;     /* use security privilege overrides */
> #endif
> extern int use_descriptors;     /* use data descriptors (extended headings=
) */
> +extern int no_add_suffix;       /* do not add suffix .zip to archive name=
s without . */
> extern int allow_empty_archive; /* if no files, create empty archive anywa=
y */
> extern int copy_only;           /* 1 =3D copy archive with no changes */
> extern int zip_to_stdout;       /* output to stdout */
>=20
> But getting something like that accepted and distributed, and for Emacs
> to tell whether the installed zip has that option or not, seems like a
> lot of work.

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 whe=
n done? Although I don=E2=80=99t have a full understanding on how that would=
 be done and whether there are problems along with it.=20=





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 6 Feb 2023 18:57:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 06 13:57:27 2023
Received: from localhost ([127.0.0.1]:49946 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pP6gA-0001Af-RP
	for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 13:57:27 -0500
Received: from virgil.koldfront.dk ([212.237.178.116]:46964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <asjo@HIDDEN>) id 1pP6g7-0001AR-Fg
 for 61326 <at> debbugs.gnu.org; Mon, 06 Feb 2023 13:57:24 -0500
Received: from tullinup.koldfront.dk (tullinup.koldfront.dk [192.168.1.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by virgil.koldfront.dk (Postfix) with ESMTPS id 6AEF116C168F1
 for <61326 <at> debbugs.gnu.org>; Mon,  6 Feb 2023 19:57:19 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.11.0 virgil.koldfront.dk 6AEF116C168F1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koldfront.dk;
 s=mail; t=1675709839;
 bh=8R6OIpfFZsQplsGjLndxTx+os09jSUoNVL9u5p2NN8E=;
 h=From:To:Subject:Date:From;
 b=KaxAAIjJKrH78+frvcrn8gFkX+kPP8slfJkvHyHKVWJvNhSo/shlwBfFIx9GHj+d3
 ZnCV210TS3R4h1YZJB5s/ExG/lLK2rsAi8xsNsCtOZRj7Z8pysz+1y9ZGEf90ruVpF
 00n0X7+ndZmIYP0Mubu51NptOLVoDxwaLd8piEoJCihtMD2u0kGThZdKZHg+0z2VDv
 ThGizm9YeyAMs99bzwwMjywqrJW61rOUMAR1Ht4szgt/u9WH9uJ/7ONEu7LmdWxP2Z
 xuarjjDn7DI4KENUlV7VmdCVa7O8hoN/rDREozLLpfLdAKG/duVbZ3IdVbGnm1VRia
 j3uryGSqloIKg==
Received: by tullinup.koldfront.dk (Postfix, from userid 1000)
 id 57558201E2A18; Mon,  6 Feb 2023 19:57:19 +0100 (CET)
From: =?utf-8?Q?Adam_Sj=C3=B8gren?= <asjo@HIDDEN>
To: 61326 <at> debbugs.gnu.org
Subject: Adding --no-add-suffix to zip patch
Organization: koldfront - analysis & revolution, Copenhagen, Denmark
OpenPGP: id=476630590A231909B0A0961A49D0746121BDE416;
 url=https://asjo.koldfront.dk/gpg.asc
X-Now-Playing: The Real Snow White, 4:13 Dream (The Cure)
X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,
 Q(^@xk}n4Ou
 rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ
 ^St'=VZBR<gm`!Dj`dIpp?+$"$l_'JKDN\w-jB;fo0Qy}Tbw
X-Hashcash: 1:25:230206:61326 <at> debbugs.gnu.org::PdjMTJKPrt7Hxx0d:2T7O+
Date: Mon, 06 Feb 2023 19:57:19 +0100
Message-ID: <87ilgeoc4w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 61326
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Adding a '--no-add-suffix' option to zip 3.0 is not too bad:

diff -u orig/zip-3.0/globals.c chan/zip-3.0/globals.c
--- orig/zip-3.0/globals.c	2008-05-25 19:26:38.000000000 +0200
+++ chan/zip-3.0/globals.c	2023-02-06 19:42:48.000000000 +0100
@@ -106,6 +106,7 @@
 int noisy = 1;                /* 0=quiet operation */
 int extra_fields = 1;         /* 0=create minimum, 1=don't copy old, 2=keep old */
 int use_descriptors = 0;      /* 1=use data descriptors 12/29/04 */
+int no_add_suffix = 0;        /* 1=do not add suffix .zip to archive names without . */
 int zip_to_stdout = 0;        /* output zipfile to stdout 12/30/04 */
 int allow_empty_archive = 0;  /* if no files, create empty archive anyway 12/28/05 */
 int copy_only = 0;            /* 1=copying archive entries only */
diff -u orig/zip-3.0/zip.c chan/zip-3.0/zip.c
--- orig/zip-3.0/zip.c	2023-02-06 19:49:42.000000000 +0100
+++ chan/zip-3.0/zip.c	2023-02-06 19:47:26.000000000 +0100
@@ -1942,6 +1942,7 @@
 #ifdef UNICODE_TEST
 #define o_sC            0x146
 #endif
+#define o_nas           0x147
 
 
 /* the below is mainly from the old main command line
@@ -2042,6 +2043,7 @@
     {"N",  "notes",       o_NO_VALUE,       o_NOT_NEGATABLE, 'N',  "add notes as entry comments"},
 #endif
     {"o",  "latest-time", o_NO_VALUE,       o_NOT_NEGATABLE, 'o',  "use latest entry time as archive time"},
+    {"",   "no-add-suffix", o_NO_VALUE,     o_NOT_NEGATABLE, o_nas, "do not add .zip suffix to archive name without ."},
     {"O",  "output-file", o_REQUIRED_VALUE, o_NOT_NEGATABLE, 'O',  "set out zipfile different than in zipfile"},
     {"p",  "paths",       o_NO_VALUE,       o_NOT_NEGATABLE, 'p',  "store paths"},
     {"P",  "password",    o_REQUIRED_VALUE, o_NOT_NEGATABLE, 'P',  "encrypt entries, option value is password"},
@@ -2378,6 +2380,7 @@
   before = 0;             /* 0=ignore, else exclude files before this time */
   after = 0;              /* 0=ignore, else exclude files newer than this time */
 
+  no_add_suffix = 0       /* 0=add .zip if no . as usual, else use archive name unchanged */
   special = ".Z:.zip:.zoo:.arc:.lzh:.arj"; /* List of special suffixes */
   key = NULL;             /* Scramble password if scrambling */
   key_needed = 0;         /* Need scramble password */
@@ -3299,6 +3302,11 @@
           break;
 #endif
 
+        case o_nas:
+          no_add_suffix = 1;
+          break;
+
+
         case o_NON_OPTION_ARG:
           /* not an option */
           /* no more options as permuting */
@@ -3340,8 +3348,14 @@
 #endif /* !MACOS && !WINDLL */
               {
                 /* name of zipfile */
-                if ((zipfile = ziptyp(value)) == NULL) {
-                  ZIPERR(ZE_MEM, "was processing arguments");
+                if (no_add_suffix) {
+                  zipfile = value;
+                }
+                else {
+                  if ((zipfile = ziptyp(value)) == NULL) {
+                    ZIPERR(ZE_MEM, "was processing arguments");
+                  }
+                  free(value);
                 }
                 /* read zipfile if exists */
                 /*
@@ -3349,7 +3363,6 @@
                   ZIPERR(r, zipfile);
                 }
                 */
-                free(value);
               }
               if (show_what_doing) {
                 fprintf(mesg, "sd: Zipfile name '%s'\n", zipfile);
diff -u orig/zip-3.0/zip.h chan/zip-3.0/zip.h
--- orig/zip-3.0/zip.h	2008-05-25 19:23:22.000000000 +0200
+++ chan/zip-3.0/zip.h	2023-02-06 19:43:41.000000000 +0100
@@ -442,6 +442,7 @@
  extern int use_privileges;     /* use security privilege overrides */
 #endif
 extern int use_descriptors;     /* use data descriptors (extended headings) */
+extern int no_add_suffix;       /* do not add suffix .zip to archive names without . */
 extern int allow_empty_archive; /* if no files, create empty archive anyway */
 extern int copy_only;           /* 1 = copy archive with no changes */
 extern int zip_to_stdout;       /* output to stdout */

But getting something like that accepted and distributed, and for Emacs
to tell whether the installed zip has that option or not, seems like a
lot of work.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 6 Feb 2023 18:15:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 06 13:15:47 2023
Received: from localhost ([127.0.0.1]:49867 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pP61q-0008O7-PW
	for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 13:15:46 -0500
Received: from virgil.koldfront.dk ([212.237.178.116]:36916)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <asjo@HIDDEN>) id 1pP61o-0008Nv-4P
 for 61326 <at> debbugs.gnu.org; Mon, 06 Feb 2023 13:15:45 -0500
Received: from tullinup.koldfront.dk (tullinup.koldfront.dk [192.168.1.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by virgil.koldfront.dk (Postfix) with ESMTPS id C123416C1623D
 for <61326 <at> debbugs.gnu.org>; Mon,  6 Feb 2023 19:15:41 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.11.0 virgil.koldfront.dk C123416C1623D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koldfront.dk;
 s=mail; t=1675707341;
 bh=kmAVuEw1FiaUHYXsZ6T37F9mDtD0Z+cvpdTbSvJNkqk=;
 h=From:To:Subject:In-Reply-To:References:Date:From;
 b=Myb+vFTmHhrbmYJ7uCbI2WRdmIbd45XdzIO0OS56aCISE8+YGjS/8CE4QfYwe8kc1
 eLBp6uAo50ddBtIQmxavdK96/tXb6gsUwl7OudaRHoH0jJq4tRZl//5gXh2tS4mEy+
 5Jk/ktJE4EUjEBGQ61chlTpmUHPW9FnqcxjV7jsy4qKx5gAgmmAnDuQ5F0dQ/OGk/7
 kftMDSSMjKmMVLk/XRxAeHfluGAJUsBL+XHeSRHkpqsWDRwWqQrmfAT5XEQ+x9MQeJ
 CqySI4Q1rOHAIxf69O8Wo8ASg43cIqdEFyxlZJlIichwMnMrSjfQGtIW3zdMu+LHo2
 zV9Xn+IfLPE7g==
Received: by tullinup.koldfront.dk (Postfix, from userid 1000)
 id A866D201A00FD; Mon,  6 Feb 2023 19:15:41 +0100 (CET)
From: =?utf-8?Q?Adam_Sj=C3=B8gren?= <asjo@HIDDEN>
To: 61326 <at> debbugs.gnu.org
Subject: Re: bug#61326: 30.0.50; Editing fil in zip file without extension
 save creates new file
In-Reply-To: <83mt5qpt4w.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 06 Feb
 2023 20:04:47 +0200")
Organization: koldfront - analysis & revolution, Copenhagen, Denmark
References: <87zg9qohk1.fsf@HIDDEN> <83mt5qpt4w.fsf@HIDDEN>
OpenPGP: id=476630590A231909B0A0961A49D0746121BDE416;
 url=https://asjo.koldfront.dk/gpg.asc
X-Now-Playing: The Real Snow White, 4:13 Dream (The Cure)
X-Hashcash: 1:25:230206:61326 <at> debbugs.gnu.org::6Ygp+FV4lqnFbH/x:W3EC
X-Hashcash: 1:25:230206:eliz@HIDDEN::SLJETlCsKWQWw75H:15fSq
X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,
 Q(^@xk}n4Ou
 rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ
 ^St'=VZBR<gm`!Dj`dIpp?+$"$l_'JKDN\w-jB;fo0Qy}Tbw
Date: Mon, 06 Feb 2023 19:15:41 +0100
Message-ID: <87mt5qoe2a.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 61326
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Eli writes:

> I suspect that the fact the archive has .zip appended is because
> that's what the 'zip' program does.

Yes - I skimmed the man-page for zip(1), and there doesn't seem to be an
option to turn off "add .zip if there is no '.' in the filename" -
unfortunately, that would have been really handy here.

> Did you try looking at the command that Emacs invokes when you update
> a member of the archive?

I did not.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at 61326 <at> debbugs.gnu.org:


Received: (at 61326) by debbugs.gnu.org; 6 Feb 2023 18:04:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 06 13:04:44 2023
Received: from localhost ([127.0.0.1]:49850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pP5rA-00085m-HD
	for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 13:04:44 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60854)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pP5r8-00085a-Cd
 for 61326 <at> debbugs.gnu.org; Mon, 06 Feb 2023 13:04:42 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pP5r2-00044g-2d; Mon, 06 Feb 2023 13:04:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Tzsbudb3b2rGDz6lSRM4Oh+mEHPH/9cqIqvPEPUIxvA=; b=E4UrEt31MuBI4kNvi98p
 NX4hWC0xIzyQiEe9AHP5cfpcXIB2FCgyGPp1O8HxFz6kjUb5WGuqsjA31qzVL3zZwd8hunLZfu8wF
 nlF9zgGizY504F//mYjuTi2iNYg+H7H+8wARwXAOWpNzLJ2sHL+82+srVEorzS3+4zxbi+Ny4370M
 g9f1j1UIn1piK8D+lsze/XIWKCm+2wB9+8XhDB899JH5SLR8/2asV257UAjeaebGT56oMv2UbNDkO
 6IgtgyRFiB/oATM5x6aGe4WGkNMtqC/iuQ64yseF9O43lgvfr4Fae3JsX8wcj9uz/FtxFyY9tT47Y
 WVgipTro8dbgeg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pP5r1-0000bM-7u; Mon, 06 Feb 2023 13:04:35 -0500
Date: Mon, 06 Feb 2023 20:04:47 +0200
Message-Id: <83mt5qpt4w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Adam =?utf-8?Q?Sj=C3=B8gren?= <asjo@HIDDEN>
In-Reply-To: <87zg9qohk1.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#61326: 30.0.50;
 Editing fil in zip file without extension save creates new file
References: <87zg9qohk1.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61326
Cc: 61326 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 06 Feb 2023 18:00:14 +0100
> From:  Adam Sjøgren via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 
> If I open a zip archive in Emacs, I get a listing of files within the
> archive, and I can edit the files by pressing RET, and if I then save
> the file, Emacs updates the archive.
> 
> However, if the zip archive doesn't have ".zip" (or ".jar") at the end
> of the filename, Emacs instead of updating the archive opened, creates a
> new archive with ".zip" added.

AFAIR, Emacs uses the 'zip' program to create or update a zip archive,
and I suspect that the fact the archive has .zip appended is because
that's what the 'zip' program does.

Did you try looking at the command that Emacs invokes when you update
a member of the archive?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Feb 2023 17:00:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 06 12:00:35 2023
Received: from localhost ([127.0.0.1]:49751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pP4r4-00064n-Sj
	for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 12:00:35 -0500
Received: from lists.gnu.org ([209.51.188.17]:48724)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <asjo@HIDDEN>) id 1pP4r2-00064f-Uh
 for submit <at> debbugs.gnu.org; Mon, 06 Feb 2023 12:00:33 -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 <asjo@HIDDEN>) id 1pP4qx-0002lI-T4
 for bug-gnu-emacs@HIDDEN; Mon, 06 Feb 2023 12:00:32 -0500
Received: from virgil.koldfront.dk ([212.237.178.116])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <asjo@HIDDEN>) id 1pP4qt-00070z-TE
 for bug-gnu-emacs@HIDDEN; Mon, 06 Feb 2023 12:00:26 -0500
Received: from tullinup.koldfront.dk (tullinup.koldfront.dk [192.168.1.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by virgil.koldfront.dk (Postfix) with ESMTPS id 16EB816C168F1
 for <bug-gnu-emacs@HIDDEN>; Mon,  6 Feb 2023 18:00:14 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.11.0 virgil.koldfront.dk 16EB816C168F1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koldfront.dk;
 s=mail; t=1675702814;
 bh=dVBc0XIPiCfOaMR9fdn01abUwypAASst4juHYfvdrJY=;
 h=From:To:Subject:Date:From;
 b=DkdOIl4fb3YocNYsVMUmHXuhYDfh427LshXIxMUM4lZC0RarfJY6FQ82BYV/TiLnL
 RgrEuF42eTeh5VpkOvcloDrfCMHL5SK18QK6PH4zqwli8LSHRafBGKhnGq4nvwOl1e
 fj5HwaHjV++X6zDXkXT8BBf496qN+WUTg2282t8DFTAQ7sz+z7Unc7llWSPJ3NIv6g
 q8XpYjLfQiD065AuyBQ8IYJBoM7ksEBm5foPkxOqqJastL7p0V4XMJp8sXZTlZP6+M
 VlIxGP8HIf+0oetrVLs/WALDcf6jUOjWeju1OYI/QS+AcCbwB7OSn5JyFvWn8Hn+iV
 zmspefHeVjzcQ==
Received: by tullinup.koldfront.dk (Postfix, from userid 1000)
 id 0643C201A00FD; Mon,  6 Feb 2023 18:00:14 +0100 (CET)
From: =?utf-8?Q?Adam_Sj=C3=B8gren?= <asjo@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; Editing fil in zip file without extension save creates new
 file
Organization: koldfront - analysis & revolution, Copenhagen, Denmark
OpenPGP: id=476630590A231909B0A0961A49D0746121BDE416;
 url=https://asjo.koldfront.dk/gpg.asc
X-Now-Playing: The Real Snow White, 4:13 Dream (The Cure)
X-Hashcash: 1:25:230206:bug-gnu-emacs@HIDDEN::dN7UVlw/KqLXJXab:2RNvq
X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,
 Q(^@xk}n4Ou
 rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ
 ^St'=VZBR<gm`!Dj`dIpp?+$"$l_'JKDN\w-jB;fo0Qy}Tbw
Date: Mon, 06 Feb 2023 18:00:14 +0100
Message-ID: <87zg9qohk1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=212.237.178.116; envelope-from=asjo@HIDDEN;
 helo=virgil.koldfront.dk
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)


If I open a zip archive in Emacs, I get a listing of files within the
archive, and I can edit the files by pressing RET, and if I then save
the file, Emacs updates the archive.

However, if the zip archive doesn't have ".zip" (or ".jar") at the end
of the filename, Emacs instead of updating the archive opened, creates a
new archive with ".zip" added.

Example:

    $ echo ABBA > a.txt
    $ zip a.zip a.txt
      adding: a.txt (stored 0%)
    $ mv a.zip extless
    $ ls
    a.txt  extless
    $ emacs -Q extless=20
    $ # RET on a.txt, add to content, save
    $ ls
    a.txt  extless  extless.zip
    $=20

I was expecting the zip archive I opened, "extless" to be updated,
instead of a new file "extless.zip" appearing.

The expected behaviour is useful when editing e.g. "zipimport" binaries,
such as yt-dlp: https://github.com/yt-dlp/yt-dlp#release-files


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.36, cairo version 1.16.0) of 2023-01-15 built on tullinup
Repository revision: b017c0453c73798c30b2f046bfa62a57cf6ea72b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101006
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure -C --with-tree-sitter --with-librsvg --with-xinput2
 --without-pgtk --with-native-compilation=3Daot'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  age-encryption-mode: t
  pixel-scroll-precision-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  dumb-jump-mode: t
  shell-dirtrack-mode: t
  which-function-mode: t
  global-auto-complete-mode: t
  save-place-mode: t
  jabber-activity-mode: t
  winner-mode: t
  server-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  buffer-read-only: t
  line-number-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
~/elisp/let-alist/let-alist hides ~/elisp/extra/let-alist
/home/asjo/elisp/boxquote.el/boxquote hides ~/elisp/extra/boxquote
~/elisp/let-alist/let-alist hides /usr/src/emacs/lisp/emacs-lisp/let-alist

Features:
(shadow bbdb-message emacsbug shr-color executable js-mode-expansions js
c-ts-mode treesit cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs flow-fill rng-xsd
xsd-regexp rng-cmpct nxml-mode-expansions rng-nxml rng-valid rng-loc
rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap nxml-util nxml-enc xmltok jka-compr
mm-archive bbdb-gnus-aux qp mule-util url-http url-gw url-auth
gnus-gravatar gravatar sort smiley gnus-cite textsec uni-scripts
idna-mapping ucs-normalize uni-confusable textsec-check gnus-bcklg
gnus-async gnus-dup gnus-ml disp-table gnus-topic utf-7 imap rfc2104
face-remap epa-file network-stream nsm nnml bbdb-gnus bbdb-mua nnnil
gnus-demon gnus-delay gnus-draft gnus-agent gnus-srvr gnus-score
score-mode nnvirtual nntp gnus-cache nndraft nnmh mail-extr spam
spam-stat bbdb-com gnus-uu yenc gnus-msg gnus-html url-queue help-fns
radix-tree url-cache mm-url bbdb-picture gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum shr pixel-fill kinsoku url-file svg
gnus-group gnus-undo gnus-fun hashcash gnus-start gnus-dbus gnus-cloud
nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range
gnus-win gnus nnheader range flymake-proc flymake time age pixel-scroll
cua-base litable magithub magithub-ci magithub-issue magithub-cache
magithub-core magit-submodule magit-obsolete magit-popup magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log magit-diff smerge-mode diff git-commit log-edit
message sendmail yank-media rfc822 mml mml-sec epa epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util magit-core magit-autorevert autorevert
filenotify magit-margin magit-transient magit-process with-editor
magit-mode magit-git magit-section benchmark magit-utils vc-git
diff-mode ido crm markdown-mode color noutline outline rg pcase
rg-info-hack rg-menu transient rg-ibuffer ibuf-macs rg-result wgrep-rg
rg-history rg-header ibuf-ext ibuffer ibuffer-loaddefs wgrep grep
compile text-property-search dumb-jump f dash s etags fileloop generator
xref project tramp tramp-loaddefs trampver tramp-integration cus-edit pp
cus-load files-x tramp-compat shell pcomplete parse-time iso8601 ls-lisp
auto-loads tex-site expand-region subword-mode-expansions
cperl-mode-expansions text-mode-expansions html-mode-expansions
er-basic-expansions thingatpt expand-region-core expand-region-custom
which-func cperl-mode auto-complete-config auto-complete edmacro kmacro
popup debian-changelog-mode imenu add-log dpkg-dev-el saveplace vc
vc-dispatcher bbdb bbdb-site timezone bbdb-loaddefs julia-mode
julia-mode-latexsubs boxquote rect jabber-last-message-correction
jabber-http-file-upload jabber-print-html jabber-otr jabber
jabber-notifications notifications jabber-libnotify dbus jabber-awesome
jabber-osd jabber-wmii jabber-xmessage jabber-festival jabber-sawfish
jabber-ratpoison jabber-tmux jabber-screen jabber-socks5
jabber-ft-server jabber-si-server jabber-ft-client jabber-ft-common
jabber-si-client jabber-si-common jabber-feature-neg jabber-truncate
jabber-time jabber-autoaway time-date jabber-vcard-avatars
jabber-chatstates jabber-events jabber-vcard jabber-avatar
jabber-activity jabber-watch jabber-modeline easy-mmode advice
jabber-ahc-presence jabber-ahc jabber-version jabber-ourversion
jabber-muc-nick-completion hippie-exp comint ansi-osc ansi-color
jabber-browse jabber-search jabber-register jabber-roster format-spec
jabber-presence jabber-muc jabber-bookmarks jabber-private
jabber-muc-nick-coloring hexrgb jabber-widget jabber-disco wid-edit
jabber-chat jabber-history jabber-chatbuffer jabber-alert jabber-iq
jabber-core jabber-console derived sgml-mode facemenu dom ewoc
jabber-keymap jabber-sasl sasl sasl-anonymous sasl-login sasl-plain fsm
jabber-logon jabber-conn comp comp-cstr warnings icons rx cl-extra
help-mode srv dns starttls tls jabber-xml xml jabber-menu jabber-util cl
winner ring gnutls puny find-file-from-selection find-lisp dired
dired-loaddefs cap-words superword subword server finder-inf package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd 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 dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1135254 142749)
 (symbols 48 43507 17)
 (strings 32 298866 21178)
 (string-bytes 1 12616608)
 (vectors 16 98259)
 (vector-slots 8 3113739 175347)
 (floats 8 750 1097)
 (intervals 56 795 371)
 (buffers 984 33))

--=20
 "Den ene mands loft                                        Adam Sj=C3=B8gr=
en
  Er den anden mands gulv"                             asjo@HIDDEN




Acknowledgement sent to Adam Sjøgren <asjo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#61326; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 7 Feb 2023 20:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.