Summary: | WISH: add CPIO support | ||
---|---|---|---|
Product: | [Applications] ark | Reporter: | Jaan Vajakas <jaanvajakas> |
Component: | general | Assignee: | Harald Hvaal <metellius> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | gmetal31, rakuco |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.6.0 | |
Sentry Crash Report: | |||
Bug Depends on: | |||
Bug Blocks: | 192630 | ||
Attachments: |
Split libarchive_kerfuffle.desktop into two .desktop files
Splits the kerfuffle_libarchive.desktop in two files, and adds the cpio mime types to the readonly version. |
Description
Jaan Vajakas
2008-04-15 20:22:49 UTC
could you add : application/x-cpio;application/x-cpio-compressed; and the end of the "MimeType=...." line in the file /usr/share/kde4/services/kerfuffle_libarchive.desktop (maybe it is placed elsewhere on you system). Then ark should be able to open cpio archive. Could you test a few cpio archives and report if it works for you too ? Yes, now it opens CPIO archives but when I try to extract some files from a CPIO archive it says "Extraction discarding paths is not supported yet." I had a look at this bug report, and after adding: application/x-cpio;application/x-cpio-compressed; and the end of the "MimeType=...." in the file kerfuffle_libarchive.desktop, I was able to open cpio archives and extract files from it. I think that libarchive's support of cpio files must have been updated, so this bug could be closed? Hmm, have you checked different cpio formats? According to libarchive-formats(5) there are at least 3 different cpio formats it supports. The libarchive plugin code differs tar files and compressed tar files (and the different compression formats, such as gz or bz2), but does not do anything special with cpio files -- I'd like to spend some time playing with libarchive's test suite to check if we support all cpio files it does. I had a look at the different cpio formats, and it seems that libarchive supports reading all of them, and writing using the odc POSIX format (mentioned in the libarchive-formats). I created files for each one of the different formats supported by the cpio utility (v2.11), plus one gzipped cpio. I added the five different mimes types to the kerfuffle_libarchive.desktop file (x-bcpio, x-cpio, x-cpio-compressed, x-sv4cpio, x-sv4crc). For all files, including the gzipped compressed cpio file, ark would read and display their contents. Moreover, ark managed to extract the files and folders of all cpio archives that I tested. Creating cpio archives, or adding files to an existing cpio archive, however, requires changes to the ark code. But reading the archives, can be pushed into the trunk very quickly. I tested this feature with libarchive v2.7.1. Created attachment 53232 [details]
Split libarchive_kerfuffle.desktop into two .desktop files
Thanks a lot for the investigation.
Can you apply this patch locally, add the CPIO mimetypes to kerfuffle_libarchive_readonly.desktop and see if everything still works?
As we need to write more code to support creating CPIO archives, this patch splits kerfuffle_libarchive.desktop into a desktop file with a list of mimetypes we can read and write to, and another one with a list of mimetypes we can only read. For now, the CPIO mimetypes should be in the read-only list.
Oh, and remember that whenever you install the new .desktop files you will need to run kbuildsycoca4. Created attachment 53242 [details]
Splits the kerfuffle_libarchive.desktop in two files, and adds the cpio mime types to the readonly version.
Comment on attachment 53242 [details]
Splits the kerfuffle_libarchive.desktop in two files, and adds the cpio mime types to the readonly version.
Applied your patch, added the mime types, repeated the tests, and it's working. I am attaching this patch, which is the original patch, plus the cpio mime types.
SVN commit 1194909 by rkcosta: Add the CPIO mimetypes to the list of mimetypes Ark supports. In order to do that, kerfuffle_libarchive.desktop has been split into two desktop files. One of them, kerfuffle_libarchive.desktop, contains a MimeType entry with all the mimetypes which we can read _and_ write. The other one, kerfuffle_libarchive_readonly.desktop, contains the list of mimetypes we can open read-only. For now, we also move the mimetypes for Debian packages and ISO files to the list of mimetypes we can only read. Debian packages are actually CPIO archives, so it should be moved back to kerfuffle_libarchive.desktop when we implement write support for CPIO archives in general. Thanks to George Metaxas for bringing this issue up again :) BUG: 160875 M +1 -1 CMakeLists.txt M +1 -1 kerfuffle_libarchive.desktop A kerfuffle_libarchive_readonly.desktop WebSVN link: http://websvn.kde.org/?view=rev&revision=1194909 |