bug#38260: 26.3.50; zip archive mode adds new entry instead of updating file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#38260: 26.3.50; zip archive mode adds new entry instead of updating file

Mark Jeffcoat
My steps to reproduce assume you're working with this
zip file, which is publicly available:

   https://aeronav.faa.gov/Upload_313-d/cifp/CIFP_191205.zip

Open with
    emacs -Q CIFP_191205.zip

The fifth file entry is
    'cifp_201913/faacifp18'

(I don't know why it's the only entry not capitalized; that
doesn't match what I see with 'unzip -t'.)

<RET> on faacifp18 to open it, <RET> again to add a blank
line at the top, C-x C-s to save. Go back to the original
Zip-Archive buffer.

The original 'cifp_201913/faacifp18' is unchanged, my
edit was not saved.

Instead, a new entry 'cifp_201/faacifp1' has been added
to the end of the zip archive. This is not what I wanted
to happen, and doesn't match what happens on other zip
archives.

This isn't a critical bug; it's easy enough to work
around by manually extracting and re-building the zip.


Thank you for your help.



In GNU Emacs 26.3.50 (build 1, x86_64-pc-linux-gnu)
 of 2019-11-18 built on behenian
Repository revision: 55dcd32ad2209dc34bfb6b713bf73be9bf4c4cb2
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux bullseye/sid

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
File CIFP_191205.zip is large (14.8M), really open? (y or n) y
Parsing archive file...done.

Configured using:
 'configure --without-sound --with-mailutils --with-x-toolkit=no
 --with-modules --with-x'

Configured features:
XPM JPEG TIFF GIF PNG RSVG DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB OLDXMENU X11 XDBE XIM MODULES THREADS
LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Zip-Archive

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils arc-mode archive-mode
elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting x
multi-tty make-network-process emacs)

Memory information:
((conses 16 96767 8499)
 (symbols 48 20508 1)
 (miscs 40 56 143)
 (strings 32 28949 1338)
 (string-bytes 1 764767)
 (vectors 16 14233)
 (vector-slots 8 497432 11168)
 (floats 8 54 105)
 (intervals 56 255 11)
 (buffers 992 12))



Reply | Threaded
Open this post in threaded view
|

bug#38260: 26.3.50; zip archive mode adds new entry instead of updating file

Eli Zaretskii
> From: Mark Jeffcoat <[hidden email]>
> Date: Mon, 18 Nov 2019 12:36:20 -0600
>
>    https://aeronav.faa.gov/Upload_313-d/cifp/CIFP_191205.zip
>
> Open with
>     emacs -Q CIFP_191205.zip
>
> The fifth file entry is
>     'cifp_201913/faacifp18'
>
> (I don't know why it's the only entry not capitalized; that
> doesn't match what I see with 'unzip -t'.)

Because it's the only file whose name is all-caps.

> <RET> on faacifp18 to open it, <RET> again to add a blank
> line at the top, C-x C-s to save. Go back to the original
> Zip-Archive buffer.
>
> The original 'cifp_201913/faacifp18' is unchanged, my
> edit was not saved.
>
> Instead, a new entry 'cifp_201/faacifp1' has been added
> to the end of the zip archive. This is not what I wanted
> to happen, and doesn't match what happens on other zip
> archives.

Turns out we were updating the zip archives in a mode that only makes
sense on MS-DOS, or for zip files that came from MS-DOS.  I changed
the default value of archive-zip-case-fiddle to be more in line with
the current practices, and that fixed the problem.

Thanks.