|
Bugzilla – Full Text Bug Listing |
| Summary: | PackageKit: zypp backend needs implementation for GetDetailsLocal | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE Tumbleweed | Reporter: | Dominique Leuenberger <dimstar> |
| Component: | GNOME | Assignee: | Jonathan Kang <songchuan.kang> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Enhancement | ||
| Priority: | P3 - Medium | CC: | ma |
| Version: | Current | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Bug Depends on: | |||
| Bug Blocks: | 941862, 1012272, 1079825 | ||
| Attachments: |
patch implementing GetDetailsLocal
Implement GetDetailsLocal method in zypp backend |
||
|
Description
Dominique Leuenberger
2016-11-03 10:49:58 UTC
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 |