[oe-commits] Robert Yang : rpmresolve: ignore null requires

git at git.openembedded.org git at git.openembedded.org
Wed Sep 3 16:44:40 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 2f234160ff4e9eccd8794a31df851b96328f6b74
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=2f234160ff4e9eccd8794a31df851b96328f6b74

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Wed Sep  3 02:04:30 2014 -0700

rpmresolve: ignore null requires

It is not a problem if a package requires nothing (similar to RDEPENDS
is null), for example, these packages depends on nothing:

[snip]
alsa-conf-base
base-files
eglibc-binary-localedata-en-us
xserver-xf86-config
[snip]

The rpmresolve-native's algorithm is:
===fake code
for pkg in pkg1, pkg2, pkg3:
    rc = get_req(pkg)
return rc
===fake code

Suppose of the 3 pkgs requires null:
- We are lukcy if pkg1 or pkg2 is null, nothing happend.
- We are *not* lukcy if pkg3 is null, and will get the error when "INHERIT +=
  'buildhistory'":
  ERROR: Cannot get the package dependencies. Command
  '/path/to/x86_64-linux/usr/bin/rpmresolve -t /path/to/var/lib/rpm' returned 1:

This patch fixes the problem.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
index 4e9d055..7f4caf9 100644
--- a/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
+++ b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
@@ -275,7 +275,13 @@ int printDepList(rpmts *ts, int tscount)
                 char *name = strdup((char *)he->p.ptr);
                 /* Get its requires */
                 he->tag = RPMTAG_REQUIRENAME;
-                rc = (headerGet(h, he, 0) != 1);
+                if (rc = (headerGet(h, he, 0) != 1)) {
+                    if (debugmode) {
+                        printf("DEBUG: %s requires null\n", name);
+                    }
+                    rc = 0;
+                    continue;
+                }
                 ARGV_t reqs = (ARGV_t)he->p.ptr;
                 /* Get its requireflags */
                 he->tag = RPMTAG_REQUIREFLAGS;



More information about the Openembedded-commits mailing list