| Summary: | hy_package_get_requires should return also "Requires(pre)" | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Harald Hoyer <harald> |
| Component: | hawkey | Assignee: | rpm-software-management |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 24 | CC: | jmracek, mdomonko, mluscon, packaging-team-maint, pnemade, RadekHolyPublic, vmukhame |
| Target Milestone: | --- | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-03-02 09:58:10 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Harald Hoyer
2016-01-29 15:31:16 UTC
Basically it's missing "Requires(pre)" We should definitely fix this. (In reply to Michal Domonkos from comment #2) > We should definitely fix this. Yes :) Do you have a quick fix in mind, so I can continue with my research? (In reply to Harald Hoyer from comment #3) > (In reply to Michal Domonkos from comment #2) > > We should definitely fix this. > > Yes :) Do you have a quick fix in mind, so I can continue with my research? ping? we'll introduce a new repoquery option to list these requirements. It should be separated from the `--requires` as these are more like BuildRequires not necessary needed for package to run. I am sorry but there is currently no quick fix but we have it on agenda. might be a hawkey problem >>> import dnf >>> b = dnf.Base() >>> b.conf.cachedir = dnf.yum.misc.getCacheDir() >>> b.fill_sack() <dnf.sack.Sack object at 0x7f2a981b9940> >>> b.add_remote_rpm("/home/harald/Downloads/kernel-core-4.5.0-0.rc4.git0.1.fc24.x86_64.rpm") <hawkey.Package object id 4241, kernel-core-4.5.0-0.rc4.git0.1.fc24.x86_64, @commandline> >>> pkgs = b.sack.query().available().run() >>> [str(x) for x in pkgs[0].requires] ['/bin/sh', 'rpmlib(CompressedFileNames) <= 3.0.4-1', 'rpmlib(FileDigests) <= 4.6.0-1', 'rpmlib(PayloadFilesHavePrefix) <= 4.0-1', 'rpmlib(PayloadIsXz) <= 5.2-1'] >>> str(pkgs[0].name) 'kernel-core' ~$ rpm -qp --requires /home/harald/Downloads/kernel-core-4.5.0-0.rc4.git0.1.fc24.x86_64.rpm /bin/sh /bin/sh /bin/sh dracut >= 027 fileutils linux-firmware >= 20150904-56.git6ebf5d57 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 systemd >= 200 systemd >= 203-2 (In reply to Jan Silhan from comment #5) > we'll introduce a new repoquery option to list these requirements. It should > be separated from the `--requires` as these are more like BuildRequires not > necessary needed for package to run. > > I am sorry but there is currently no quick fix but we have it on agenda. Huh? Requires(pre) is absolutely needed!! This makes it work for me
~/git/hawkey (master)$ git diff
diff --git a/src/package.c b/src/package.c
index 5c7a637..781d39b 100644
--- a/src/package.c
+++ b/src/package.c
@@ -26,6 +26,7 @@
#include <solv/pool.h>
#include <solv/repo.h>
#include <solv/util.h>
+#include <solv/queue.h>
// hawkey
#include "advisory_internal.h"
@@ -65,9 +66,22 @@ reldeps_for(HyPackage pkg, Id type)
Solvable *s = get_solvable(pkg);
HyReldepList reldeplist;
Queue q;
+ Id marker = -1;
+ int i;
+ if (type == SOLVABLE_REQUIRES)
+ marker = 0;
queue_init(&q);
- solvable_lookup_deparray(s, type, &q, -1);
+ solvable_lookup_deparray(s, type, &q, marker);
+ if (type == SOLVABLE_REQUIRES) {
+ for (i = 0; i < q.count; i++) {
+ if (q.elements[i] == SOLVABLE_PREREQMARKER) {
+ queue_delete(&q, i);
+ break;
+ }
+ }
+ }
+
reldeplist = reldeplist_from_queue(pool, q);
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase ping??? Hi Harald, we decided to implement a --requires-pre switch. PR is available at https://github.com/rpm-software-management/libhif/pull/95 . (In reply to Michal Luscon from comment #11) > Hi Harald, > > we decided to implement a --requires-pre switch. PR is available at > https://github.com/rpm-software-management/libhif/pull/95 . Thanks! Although, I don't need the patch anymore. I thought, that Requires(pre) implies a normal Requires, which is apparently not the case. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. Released in libdnf-0.7.4 in fedora rawhide. |