Bugzilla – Bug 1008287
PackageKit: zypp backend needs implementation for GetDetailsLocal
Last modified: 2018-06-14 05:53:32 UTC
In order to make use of gnome-software's capability to install local files, it requires the PackageKit backend in use to support GetDetailsLocal The zypp backend exposes the role get-details and this works 'just fine' when querying remote info, but it's not possible to call: pkcon get-details filename.rpm, e.g. kcon get-details gnome-software-3.22.1-215.1.0.x86_64.rpm Getting details [=========================] Finished [=========================] Fatal error: GetDetailsLocal not supported by backend For this reason, the RPM handler for gnome-software does not work
The ROLE would be PK_ROLE_ENUM_GET_DETAILS_LOCAL
Created attachment 720884 [details] patch implementing GetDetailsLocal Can anyone help review this patch?
Jonathan - this seems ok-ish; are other backends also copying all RPMs to a temp dir to extract the info from the rpm? No way zypp can read the file directly?
(In reply to Dominique Leuenberger from comment #3) > Jonathan - this seems ok-ish; are other backends also copying all RPMs to a > temp dir to extract the info from the rpm? Nope. In dnf backend, they use a function called dnf_sack_add_cmdline_package() to implement this. This function accepts full path of the rpm file. > No way zypp can read the file directly? I'm not quite sure about it, as I am not quite familiar with libzypp atm. The way I implemented it is learned from the implementation of backend_install_files_thread() in pk-backend-zypp.cpp. I admit that it's not a very good solution.
@Michael Could you please help review the patch in comment#2? Thanks.
(In reply to Dominique Leuenberger from comment #3) > Jonathan - this seems ok-ish; are other backends also copying all RPMs to a > temp dir to extract the info from the rpm? No way zypp can read the file > directly? https://github.com/openSUSE/libzypp/blob/master/zypp/target/rpm/RpmHeader.h If you have the header, you can extract the data
Created attachment 761391 [details] Implement GetDetailsLocal method in zypp backend I've updated the patch according to Michael's advice. But there is still one issue that I'm aware of how to fix. That is tag_name() function returns NULL for all the local rpms I tested. @Michael Could you please help check what's wrong in this patch? Thanks
@Jonathan: I can't spot a problem. Line 2179 (after target::rpm::RpmHeader::constPtr rpmHeader = ...) please add: > DBG << rpmHeader << endl; and check the output in /var/log/pk_backend_zypp. > ReferenceCounted(@0x22ea140<=1){0x23000b0}{sqldeveloper-2.1.1.64.45-1} It prints `tag_name()-tag_version()-tag_release()`. Works for me as expected. If you get a nupllptr, I'll need one of the failing rpms and the libzypp version.
(In reply to Michael Andres from comment #9) > @Jonathan: I can't spot a problem. > > Line 2179 (after target::rpm::RpmHeader::constPtr rpmHeader = ...) please > add: > > DBG << rpmHeader << endl; > and check the output in /var/log/pk_backend_zypp. > > ReferenceCounted(@0x22ea140<=1){0x23000b0}{sqldeveloper-2.1.1.64.45-1} > It prints `tag_name()-tag_version()-tag_release()`. Works for me as expected. > After adding that line and checking the output in /var/log/pk_backend_zypp, I found that it works for me as well. It seems that it's the fault of > pk_backend_job_details (). Even if I set the second parameter(which is the package id) of this function to a constant string, for example "testing". The output of "pkcon get-details ..." is still like this: > Package description > package: (null) > summary: Simple software installation management software > license: GPL-2.0-or-later > ... I'll investigate more about this. Thanks for the review.
PR created: https://github.com/hughsie/PackageKit/pull/242
RESOLVED FIXED.
This is an autogenerated message for OBS integration: This bug (1008287) was mentioned in https://build.opensuse.org/request/show/584461 Factory / PackageKit