[C2] unzip missing in /usr/bin

REPRODUCIBILITY: 100 %
OS VERSION: 5.0.0.29
HARDWARE: Jolla C2
UI LANGUAGE: deutsch
REGRESSION: yes (to SFOS 4)

DESCRIPTION:

/usr/bin/unzip is missing
There is no alternative in the path

PRECONDITIONS:

n/a

STEPS TO REPRODUCE:

open terminal
enter ls /usr/bin/unzip

EXPECTED RESULT:

unzip is found in /usr/bin or at least in the path

ACTUAL RESULT:

no such file or directory

MODIFICATIONS:

no Android
no other stores

ADDITIONAL INFORMATION:

unzip is needed for an upcoming release of my app ielig:calc to open an .ods file (e.g. LibreOffice Calc spreadsheet file). In SFOS 4 unzip is working with QProcess.start()

2 Likes

Unzip is available but not installed by default. Adding Requires: unzip to the apps spec file should do the trick.

6 Likes

That’s not allowed in Harbour though.

2 Likes

Ok. And what is the allowed solution for unzip?

zip format is pretty easy to extract oneself, w/o resorting to external program.
and libz.so can extract the deflate (8) format.

(probably the compression formats in all of the zip files are either 0 (uncompressed or something) and 8 (deflate). if there were lzma or zstd
-formatted files there is libzstd… hmm what is used for xz…

… but hey, probably simplest is to do small python program - one can
import zipfile in python3 program – at least in 4.6.x…

2 Likes

I’m afraid there isn’t any at the moment. And the dependency isn’t even the last of your problems: In order to be able to actually use unzip, you would need Sailjail permission for it, and that does not exist either.

1 Like

That’s the way. If I remember correctly liblzma handles xz.

The Sailfish.FileManager QML plugin has an ArchiveModel type which can extract various archive formats, and AFAIK is either allowed or queued to be allowed in Harbour.
Would that help?

Look at /usr/lib[64]/qt5/qml/Sailfish/FileManager/ExtractorView.qml on how to use.

Or sailfish-archive.qml in /usr/share. But the zip/unzip must be in lib I can’t see at the moment.

Thanks for all the advice. I have tested this and that. My result:

precondition:
I deal with .ods files (Open Document Spreadsheet files as described in this OASIS pdf. See page 10 ).

A .ods file is a zip archive containing many files. My task is to create / to unfold this archives. I’m NOT dealing with only 1 file inside the zip archive.

liblzma
For me liblzma deals only with 1 file. And may be not in the special zip style required. (I wrote this after reading, not after testing)

Python script
Python uses zlib. Not tested because integrate a phyton script in an existing QML/C++ project is very new for me.

Sailfish.FileManager
Not allowed in Harbour for us mortals.

File Browser app in Jolla Store
The harbour file browser app available in the Jolla store can open zip files. But also this popular app uses unzip. Please can someone testing this app and open a zip file on a Jolla C2. My C2 have now unzip installed after following the hint from direc85.


Please, can you doublecheck your decision for removing the unzip command from apps designed for the Jolla store?
Thanks.

edit: typo file manager → file browser

2 Likes

Works fine for me. I uploaded a two files .zip to my C2 and had no problem checking content and/or unpack it.

Edit:
Oh, sorry! I was testing the wrong app. I tested File Browser, not File manager.

Well, it works also with sailfish-filemanager.

Edit2:
I have no idea how that happened, because I didn’t specifically install it, but apparently I have this /usr/bin/unzip file on my C2 anyway.
My quick test might therefore be irrelevant.

2 Likes

Thanks to @eson for testing.

It would be helpful if somebody can test the File Brower app for opening a zip file on a clean C2 (/usr/bin/unzip is missing). Thanks.

You can find out with

 zypper se -i --requires unzip

Patchmanager for example, requires unzip.

2 Likes

Thank you! And patchmanager + rpm build it was.

1 Like

The File Browser app does not need unzip for opening zip files, because it actually does not open them. It just calls Qt.openUrlExternally() on the file. Which for most users just opens the file with sailfish-archive.

1 Like

My findings in the File Browser source code shows me a call for QProcess.start(“unzip”):

The FilePage.qml calls at line 426 the ConsoleModel.cpp at line 90.

By the way, if the appsupport installed you can find in /system/bin a link named “unzip”.

1 Like

Sure, but that call is not used for opening the file, i.e. via pull-down menu. It’s used when you swipe right on the FilePage. And that does not work even on my Xperia 10 III, which does have unzip installed, because the app does not have permission to use unzip.

That’s just for the content preview, i.e. for listing contents to quickly check what’s inside. It’s a non-essential feature in my eyes, and I should implement a graceful fallback for when it fails.

Running File Browser in sailjail (i.e. when it’s installed from the official store instead of Open Repos) doesn’t really make a lot of sense anyway, because it can’t access all files.

1 Like

Time to summarise this topic:

In SFOS until 4.6 there is a /usr/bin/unzip. Some apps (also in store) use this command.
In SFOS 5.0 there is no /usr/bin/unzip installed but this is can installed with Requires: unzip. But this is not allowed for harbour apps (-> store). There is no reasons named for this in this thread.

Thanks for discussing my point here in this thread.

2 Likes

Let’s try to fix that the soonest as well.

7 Likes