After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685805 - Evince can't open cbz files if zip is not installed
Evince can't open cbz files if zip is not installed
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: comics
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Comics Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-09 13:13 UTC by Gonzalo Odiard
Modified: 2017-07-19 15:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gonzalo Odiard 2012-10-09 13:13:38 UTC
In olpc images, we have unzip installed but not zip.

evince should be able to open cbz files, but say "File type Zip archive (application/zip) is not supported"

In evince/backend/comics/comics-document.c line 365 we have:

	} else if (!strcmp (mime_type, "application/x-cbz") ||
		   !strcmp (mime_type, "application/zip")) {
		/* InfoZIP's unzip program */
		comics_document->selected_command = 
				g_find_program_in_path ("unzip");
		comics_document->alternative_command =
				g_find_program_in_path ("zipnote");
		if (comics_document->selected_command &&
		    comics_document->alternative_command) {
			comics_document->command_usage = UNZIP;
			return TRUE;
		}

Something is wrong here: if is a alternative_command, should be || not &&.

Also I can't find another use of zipnote. 

Should we remove the reference to zipnote or change the logical expression?
Comment 1 Juanjo Marín 2012-10-17 12:46:14 UTC
Hi !. I don't really understand the problem. The piece of code you want to change is precisely to use unzip. The thing is we use two binaries from unzip, unzip and zipnote. The use of zipnote is a workaround to solve some problems when the name of the file has symbols that can be misinterpreted as regular expressions.

I think the name of teh variabe "alternative_command" is misleading, is more like a secondary_command.

The point is, if you use unzip, you should have zipnote as well. It is supposed unzip provides funzip,unzip,unzipsfx,zipgrep, zipinfo.


PS: I don't like to use 3rd parties commands, so the use of a library is in my ToDo list for this release.
Comment 2 Gonzalo Odiard 2012-10-17 13:09:35 UTC
(In reply to comment #1)
> Hi !. I don't really understand the problem. The piece of code you want to
> change is precisely to use unzip. The thing is we use two binaries from unzip,
> unzip and zipnote. The use of zipnote is a workaround to solve some problems
> when the name of the file has symbols that can be misinterpreted as regular
> expressions.
> 
> I think the name of teh variabe "alternative_command" is misleading, is more
> like a secondary_command.
> 

Ok, I was confused by the name.

> The point is, if you use unzip, you should have zipnote as well. It is supposed
> unzip provides funzip,unzip,unzipsfx,zipgrep, zipinfo.
> 

In Fedora, the zipnote binary is in the "zip" package, not in "unzip". Right now in our env, we have unzip but not zip :(

> 
> PS: I don't like to use 3rd parties commands, so the use of a library is in my
> ToDo list for this release.

+1
Comment 3 Juanjo Marín 2012-10-17 13:18:48 UTC
>In Fedora, the zipnote binary is in the "zip" package, not in "unzip". Right
>now in our env, we have unzip but not zip :(

Hmm, this strange. This is what I've got in my Fedora box:

$ pkcon search name unzip
Installed   	unzip-6.0-6.fc18.x86_64  A utility for unpacking zip files

$ pkcon get-files unzip
Package files
  /usr/share/doc/unzip-6.0
  /usr/bin/funzip
  /usr/bin/unzip
  /usr/bin/unzipsfx
  /usr/bin/zipgrep
  /usr/bin/zipinfo
  /usr/share/doc/unzip-6.0/BUGS
  /usr/share/doc/unzip-6.0/LICENSE
  /usr/share/doc/unzip-6.0/README
  /usr/share/man/man1/funzip.1.gz
  /usr/share/man/man1/unzip.1.gz
  /usr/share/man/man1/unzipsfx.1.gz
  /usr/share/man/man1/zipgrep.1.gz
  /usr/share/man/man1/zipinfo.1.gz


What version are you using ?
Comment 4 Gonzalo Odiard 2012-10-17 13:32:30 UTC
This confirm what I say, no zipnote in unzip package, right?

[root@nautilus x86_64]# rpm -ql zip
/usr/bin/zip
/usr/bin/zipcloak
/usr/bin/zipnote
/usr/bin/zipsplit
....
Comment 5 Juanjo Marín 2012-10-19 21:08:41 UTC
Yes, you're right, zipnote is distributed with the zip package and not with unzip. 

At this moment, the only answer I can think of is to revert the changes where the use of zipnote was introduced:

$ git revert b478443e2f1f891cb1633fdc00fbf43f042d4699
[sugar 0dce35d] Revert "[comics] Correctly quote filename in zipnote command"
 1 file changed, 2 insertions(+), 4 deletions(-)

$ git revert 6012520a4da52d2a6964f5e6ac08238bcf81490b 
[sugar 52bb9cc] Revert "[comics] Adds comics_regex_quote()"

This means Bug 619248 - Can't open cbz file with [] in archive

The other workaround is to install 7a or 7za from p7zip project, because Evince can deal with cbz files with any of these commands when unzip/zipnote is not available.

And finally, you also can wait to a Evince version that will rely in libarchive and not in 3rd parties apps for decompressing comic book formats (or at least this is the plan :-)
Comment 6 Gonzalo Odiard 2012-11-21 20:41:46 UTC
(In reply to comment #5)
> 
> And finally, you also can wait to a Evince version that will rely in libarchive
> and not in 3rd parties apps for decompressing comic book formats (or at least
> this is the plan :-)

Thanks. I will wait for that :)
Comment 7 Bastien Nocera 2017-07-19 15:21:15 UTC
This is fixed in evince master for GNOME 3.26 as libarchive is now used to decompress CBZ comics.