Ticket #2151 (accepted defect)
Odd behavior when opening ZIP file that contains the same file twice
Reported by: | zaytsev | Owned by: | slavazanko |
---|---|---|---|
Priority: | minor | Milestone: | Future Releases |
Component: | mc-vfs | Version: | master |
Keywords: | Cc: | onlyjob@… | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
Forwarded from Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=347738
From: Marco Herrn <marco@mherrn.de> To: Debian Bug Tracking System <submit@bugs.debian.org> Subject: when opening zip file that contains the same file twice, mc behaves oddly Date: Thu, 12 Jan 2006 13:09:43 +0100 When a zip file contains a file with the same path and name more than once, mc doesn't display all the information. For example the bribblebox from bribble.com (available from http://prdownloads.sourceforge.net/bribble/bribble-1.5.35.tar.bz2?download) contains a Java Archive File (jar) which is in fact a zipfile with a specific structure (The jarfile is bribble-1.5.35/server/bribble-1_5_35.jar). This archive contains the file META-INF/MANIFEST.MF twice. (Of course this is wrong and the jar-file can be considered broken). These two MANIFEST.MF files have different content, so they can be distinguished. When opening this file in mc, there are two META-INF directories, each of which contains two MANIFEST.MF files. When viewing these MANIFEST.MF files (via F3), all four show the content of the same one. It would be of course better, if mc would display only one META-INF directory with two MANIFEST.MF files. And viewing them should of course display the correct contents, not the same content for both. I hope I made the problem clear. It can be easily reproduced by downloading the above mentioned tar.bz2, unpacking it and viewing the jar-file in mc. To view the actual contents, the unzip tool can be used, for example 'unzip -l bribble-1.5.35/server/bribble-1_5_35.jar' Regards Marco
I would have fixed this bug, but I don't know Perl :-( I think that duplicate directories should be trivial to filter, but I am not sure of what to do with duplicate files.
If you give them the same name, then the VFS will not able to tell which one to show. If you give them different name it's not obvious that these files are duplicate.
Maybe give them different names like with a special character that can not occur in the filenames? Then it's quite obvious that there's something wrong with the archive.
Thanks!
Attachments
Change History
comment:1 Changed 14 years ago by and
Honestly,
how do you deal with extracting of same file names inside of a jar/zip archive?
# unzip -l bribble-1_5_35.jar META-INF/MANIFEST.MF Archive: bribble-1_5_35.jar Length Date Time Name --------- ---------- ----- ---- 45 01-21-2005 12:51 META-INF/MANIFEST.MF 72 01-21-2005 12:51 META-INF/MANIFEST.MF --------- ------- 117 2 files # jar tfv bribble-1_5_35.jar META-INF/MANIFEST.MF 45 Fri Jan 21 12:51:48 CET 2005 META-INF/MANIFEST.MF 72 Fri Jan 21 12:51:06 CET 2005 META-INF/MANIFEST.MF
How do you use jar/unzip to extract one of two files with same name?
# unzip -p bribble-1_5_35.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 Created-By: 0.92-gcc Manifest-Version: 1.0 Main-Class: com.bribble.nl.Core.BRIBBLEserver # jar xfv bribble-1_5_35.jar META-INF/MANIFEST.MF && ll META-INF/MANIFEST.MF extracted: META-INF/MANIFEST.MF inflated: META-INF/MANIFEST.MF -rw-r--r-- 1 mc mc 72 Jan 21 2005 META-INF/MANIFEST.MF
If this special handling is clear, mc can maybe fixed.
comment:2 Changed 14 years ago by slavazanko
- Status changed from new to accepted
- Owner set to slavazanko