Remove usage of RPMVSF_NOSIGNATURES

RPM5 has removed support for RPMVSF_NOSIGNATURES

Patch smart to no longer use this flag

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Fix smart RPM backend to handle rpm-dbpath/rpm-root properly

Don't assume that if the dbpath starts with / that it is an absolute
path. This matches the behaviour of rpm itself. (If the root path is
specified and does not start with /, rpm will prepend the root path
twice and fail).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Handle recommended packages in core and rpm backends

Identify and store recommended packages in the cache, add a query option
to read them and ignore them if they are not present when installing.

Initial identification code from Mark Hatle <mark.hatle@windriver.com>.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add support for defining extra RPM macros

Allow defining extra macros in the smart configuration to be passed
to rpm before opening the database.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add ability to set RPM dependency flags in configuration

Add rpm-noupgrade, rpm-norequires, rpm-noconflicts, rpm-noobsoletes,
rpm-noparentdirs, rpm-nolinktos, and rpm-nosuggest configuration
options, corresponding to the existing dependency flags in RPM.

This is useful for OpenEmbedded so that we can do the equivalent of
the --nolinktos and --noparentdirs rpm command line options.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Use assertion correctly to avoid rpm-md parsing issue with assertions off

If assertions are disabled, then the queue.pop() wasn't being executed,
leading to requires, recommends etc. not being read properly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Do not create /var/tmp within root filesystem in RPM backend

This doesn't appear to be needed, and breaks installation of base-files
in OpenEmbedded (since that is a symlink installed as part of the
package).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
backends/rmp/metadata.py: Fix incorrect call to the match function

The match function should take three parameters, name, comparison, version...
The original code was passing it a reference to the object holding the data
instead, which caused the comparison in match to always fail.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Improve error reporting in smart

Add code to check proper command line arguments for various
smart commands. Exit with error if erroneous/additional arguments
are given in the command line.

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Fix multilib handling in RPM backend

To fix some multilib issues, change the way the RPM backend decides
if two packages can coexist: if they have a different architecture,
automatically assume that they can coexist (which is fundamental for
multilib).

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Print a more friendly error if YAML output is requested without PyYAML

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Report a reason when a dependency could not be installed because it is locked

If a requirement of a package is conflicted, depending on how the
solution is reached, the transaction code may eliminate all providers
of the requirement and then error out because nothing provides them. To
work around this, store a reason in the locked dict and report that back
if we need to, so for example instead of:

  error: Can't install packagegroup-core-ssh-dropbear-1.0-r1@all: no package provides dropbear

we now get:

  error: Can't install packagegroup-core-ssh-dropbear-1.0-r1@all: unable to install provider for dropbear:
  error:     dropbear-2013.58-r1.0@armv5te is conflicted by openssh-sshd-6.2p2-r0@armv5te

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add ignore-recommends flag support

Allow configuring recommends on specific packages to be ignored.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add exclude-packages flag support

Allow configuring specific packages to be excluded.  This will allow
users to specify things NOT to install, and if they are attempted an
error will be generated.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Add a simple method to disable the install of recommended packages

Usage:
   smart config --set ignore-all-recommends=1

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Add mechanism to attempt install without failing

In OpenEmbedded, for complementary and 'attemptonly' package processing,
we need a way to instruct smart to try to install, but ignore any
failures (usually conflicts).

This option only works for the install operation.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
fetcher.py: truncate the filename to meet NAME_MAX

The function getLocalPath() converts the filepath into the filename,
there would be a "File name too long" error when len(filename) >
NAME_MAX, truncate it to meet NAME_MAX will fix the problem.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>