Summary: | Support for file type RPM | ||
---|---|---|---|
Product: | [Applications] ark | Reporter: | Paul Bolle <pebolle> |
Component: | general | Assignee: | Raphael Kubo da Costa <rakuco> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | gilboad, gmetal31, godutchnow, kde, paulvonwinckelmann, rakuco |
Priority: | NOR | Keywords: | junior-jobs |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.7.0 | |
Sentry Crash Report: | |||
Bug Depends on: | |||
Bug Blocks: | 192630 | ||
Attachments: |
Adds rpm R/O support to ark if LibArchive >= 2.8.0
Adds rpm R/O support to ark if LibArchive >= 2.8.0 v2 Adds rpm R/O support to ark if LibArchive >= 2.8.0 v3 |
Description
Paul Bolle
2003-07-08 21:21:23 UTC
RPM Packages weren't made to have its files extracted or added to. They were made to be installed only. And that functionality is already present in KPackage (not in Ark). Thanks for commenting on my bug (and on my comment on bug 59020). I'm not sure whether rpm's were made to be installed only. (Were deb's made to be installed only?) Anyway, adding files to an rpm seems indeed to be a bad idea (deleting a file from an rpm doesn't sound to smart, too). But "opening" an rpm, viewing its contents (mostly files, but also "meta-data") is another story. And there's nothing wrong with extracting files from an rpm too... at least, I do it quite often. rpm2cpio seems to have been created for that purpose. Please note that Maximum RPM, a great book on rpm's, has got a paragraph called "Extracting one or more files from a package file", explaining how to use rpm2cpio for that purpose. So I still think it would be nice if Ark would support those actions (opening rpm's, viewing of the files "archived" in an rpm, extracting files from an rpm) too. Well, since MC ( Midnight Commander ) do a task similar to what Paul propose, i think that it's not a big deal add extract support to RPM package, but i understand what Thiago means about add. Even we have the right tools to manipulate RPM packages, we can't mess on the package structure, as .DEB, so if RPM handling will be implementes, just extract in read only form will be allowed. But there still some critical bugs to close before, so need wait some more *** This bug has been confirmed by popular vote. *** I've had a look at Gnome's "Archive Manager" - it supports read-only access to RPM files. I personally find this useful as it allows me to examine source RPMs without needing to drop to the command line and create temporary files (by running "rpm2cpio blah.src.rpm | cpio -i"). One useful addition for consideration if this is implemented might be to add in some extra files to the view in order to expose any scripts contained in the RPM (i.e. what you get if you do "rpm -qp --scripts /path/to/rpm") - if these appeared in ark as "scripts/preinstall" etc. then that would be very cool. *** Bug 214047 has been marked as a duplicate of this bug. *** Created attachment 53324 [details]
Adds rpm R/O support to ark if LibArchive >= 2.8.0
LibArchive added support for RPM in version 2.8.0 onwards. So all is needed is to added the RPM mime type to the appropriate .desktop file. I tested that with the trunk version, and I could extract the files from inside an RPM package.
I added the mime type to the newly introduced kerfuffle_libarchive_readonly.desktop file. I've also added some code in the cmake files, to check at compile time, the version of LibArchive, and strip the RPM mime type from the .desktop file, if the detected LibArchive version is < 2.8.0.
Sorry for taking an absurd time to respond :) I'd take a different approach to the CMake magic: * Although FindLibArchive.cmake currently defines HAVE_LIBARCHIVE_FOO_SUPPORT, they're defined in a different way in comparison to HAVE_LIBARCHIVE_RPM_READONLY_SUPPORT -- the former definitions depend on whether specific symbols are found in the library, whereas the latter depends only on the library version. I'd export the library version variable and add the rpm check in the appropriate Ark CMakeLists.txt * sed and cp are not portable commands, and we should not rely on them. Instead, I was thinking of adding something like @rpm-mimetype@ to a kerfuffle_libarchive_readonly.desktop.in file, and then call CMake's configure_file() to add the appropriate value when RPM support is present. Oh, and VERSION_LESS/VERSION_GREATER fit better than STRLESS/STRGREATER for version comparisons. Changing the default assignee for currently open Ark bug reports to me. Created attachment 54380 [details]
Adds rpm R/O support to ark if LibArchive >= 2.8.0 v2
Followed your advice and created the above patch. Used configure_file to add RPM support if the version requirement is met. The LibArchive version is exported from the FindLibArchive.cmake file.
The new patch looks almost OK. +# LibArchive_VERSION - the libarchive version We should change the other variables to LibArchive_FOO too, as the file is called FindLibArchive.cmake, not FindLIBARCHIVE. However, that should be taken care of in a separate patch. Could you please follow the naming convention here? + file(READ ${LIBARCHIVE_INCLUDE_DIR}/archive.h LibArchive_VERSION_CONTENT) This and the rest of the block should be enclosed by an if (LibArchive_INCLUDE_DIR) block. +set(LibArchive_RPM_SUPPORT_MIN_VERSION "2.8.0") Style nitpick: this could go right above the block that uses this variable. +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_libarchive_readonly.desktop + ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libarchive_readonly.desktop +) Since the .desktop file in Ark's source now needs to be preprocessed, it should now be called kerfuffle_libarchive_readonly.desktop.cmake -- I've talked to the i18n guys, and it seems to be easy to make Scripty extract the translations from .desktop.cmake files too. Plus, you now need to install the desktop file from the cmake binary dir, not the original one. Now that the 4.6 has been created, we can finally add your next patch to trunk :) Created attachment 55173 [details]
Adds rpm R/O support to ark if LibArchive >= 2.8.0 v3
Updated the patch according to your latest recommendations.
SVN commit 1209188 by rkcosta: Close our oldest open wishlist item: RPM support. After about 7,5 years, Ark finally has RPM support, thanks to libarchive. Note libarchive >= 2.8.0 is required. Thanks a lot to George Metaxas <gmetal31 AT gmail com> for the patch! BUG: 60942 FIXED-IN: 4.7.0 M +13 -1 ark/plugins/libarchive/CMakeLists.txt D ark/plugins/libarchive/kerfuffle_libarchive_readonly.desktop A ark/plugins/libarchive/kerfuffle_libarchive_readonly.desktop.cmake ark/plugins/libarchive/kerfuffle_libarchive_readonly.desktop#1209180 M +11 -0 cmake/modules/FindLibArchive.cmake WebSVN link: http://websvn.kde.org/?view=rev&revision=1209188 Thanks! What happened to this? RPM support does not seem to be present in KDE 4.7.3 with libarchive 2.8.5 on Fedora 16. It depends on your distro's libarchive having support for rpm archives -- Ark just checks if it has the symbol `archive_read_support_compression_rpm` defined. Please double-check with Fedora if their libarchive has rpm support. Sorry, I was looking at the current code in master. The code checking for rpm support in in 4.7 looks wrong indeed. Git commit a1b71a5073f7a0e268d0249904f3836ad28930fb by Raphael Kubo da Costa. Committed on 13/11/2011 at 22:27. Pushed by rkcosta into branch 'KDE/4.7'. Use the RPM support detection code from f8a2d09 in master. *sigh* It looks like in the conversion from svn to git the changes to FindLibArchive.cmake in SVN r1209188 which defined LIBARCHIVE_VERSION were did not make it to git. This means the version check always failed and Ark always thought libarchive did not have RPM support... CCBUG: 60942 M +7 -5 cmake/modules/FindLibArchive.cmake M +3 -0 plugins/CMakeLists.txt M +2 -5 plugins/libarchive/CMakeLists.txt http://commits.kde.org/ark/a1b71a5073f7a0e268d0249904f3836ad28930fb |