rpmresolve: ignore null requires
authorRobert Yang <liezhi.yang@windriver.com>
Wed, 3 Sep 2014 09:04:30 +0000 (02:04 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Sep 2014 15:00:28 +0000 (16:00 +0100)
commitdae723833dfb3c5956841675ec23f469bd2dcee3
tree96130f5ca7e1185f2be4d776443cb8fc267c6188
parent673e8ee774aba01e8c6a34a6f70a64684707d47e
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.

(From OE-Core rev: 2f234160ff4e9eccd8794a31df851b96328f6b74)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c