Commit Graph

25 Commits

Author SHA1 Message Date
Robert Yang 37cb3e3aa4 python-smartpm: truncate the filename to meet NAME_MAX
There is a "File name too long" error when len(TMPDIR) = 410, this is
because the function getLocalPath() converts the filepath into the
filename, so there would be the error when len(filename)
> NAME_MAX, truncate the filename to meet NAME_MAX will fix the problem.

[YOCTO #5201]

(From OE-Core rev: 9f0427edee6bf62d3fe7cdceb07f59a5776c8c4f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17 19:34:56 +01:00
Mark Hatle 4b2d9acda8 python-smartpm: Add an attempt install mode
[ YOCTO #3723 ]

Add a mode to smart that will allow an installation to continue, instead of
failure in the case that one or more items is uninstallable.

Uninstallable packages are simply ignored, and no error is generated.

(From OE-Core rev: bdf07b1698d228dc7ff555199a269b1ff8ceca19)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-11 11:06:11 +01:00
Mark Hatle 33a3eac5a0 python-smartpm: Add support to disable installing recommends
In order to attempt to reduce image sizes by skipping recommended packages,
a new mode was added to smart that only evaluates required packaged.

(From OE-Core rev: 6fd8141bbdcd84c591149d84ad84effc2357de72)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 18:30:00 +01:00
Mark Hatle 02c96776de python-smartpm: Add support for excluding package from the install
Update smart to support a mechanism for excluding specific packages from the
install process.  An error will be generated if this package is required.

(From OE-Core rev: 87660d636c2ebe76cd9dff2a334f135def9a0cf3)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-22 18:29:59 +01:00
Paul Eggleton c1a74368ee python-smartpm: add ignore-recommends package flag
Adds support for a flag that is saved into Smart's configuration against
a package that says it should not be installed if it is only recommended
by a package being installed rather than required. This will enable us
to add BAD_RECOMMENDATIONS support for RPM.

(From OE-Core rev: 70517fca31261c1ca4b15bb38f8960b2f95993ba)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 13:09:14 +01:00
Paul Eggleton e8dfbb092c python-smartpm: fix sometimes reporting no provider instead of conflict
If a requirement of a package is conflicted, depending on how the
solution is reached, Smart's transaction code may eliminate all
providers of the requirement and then error out because nothing provides
them without saying why. To work around this, store a reason 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 will 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

Fixes [YOCTO #4305].

(From OE-Core rev: 1ed09b87fc8780d4a99f6516493fae2e0c92862c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 13:09:14 +01:00
Paul Eggleton 4c6939f657 python-smartpm: add gettext-native to DEPENDS
Fixes the following failure at do_install building python-smartpm-native
if gettext-native has not already been built and gettext tools are not
installed on the host:

| compiling locale/it/LC_MESSAGES/smart.po -> locale/it/LC_MESSAGES/smart.mo
| sh: msgfmt: command not found
...
| creating $D/usr/share/share/locale/it/LC_MESSAGES
| error: can't copy 'locale/it/LC_MESSAGES/smart.mo': doesn't exist or not a regular file

Note that we need gettext-native in DEPENDS and not "inherit gettext"
here because for native variants, gettext.bbclass instead adds
gettext-minimal-native to DEPENDS and that does not provide the msgfmt
command.

(From OE-Core rev: e8d903e2d5e0c0df18dfd9561c3f8ef340297f1f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30 21:00:56 +01:00
Paul Eggleton 612ad98ed2 python-smartpm: fix HOMEPAGE and adjust DESCRIPTION
* HOMEPAGE was incorrect
* We're not really interested in the fact that Smart works across
  different distros.

(From OE-Core rev: a7f8989e027abea84a371703909f62a8b9a03177)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-29 14:45:05 +01:00
Bogdan Marinescu 02ae9b3576 smart: disable CHANNELSDIR
Make CHANNELSDIR in smart empty, since this causes host contamination issues
on some RPM-based hosts on which smart is already installed.

[YOCTO #3881]

(From OE-Core rev: 94e76a98b6cdafe9547630be159401ac1d8c5edd)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-08 16:57:03 +01:00
Paul Eggleton 0d85fa531b python-smartpm: show friendly error if YAML output requested without PyYAML
Instead of a python backtrace, tell the user they need to install PyYAML
if they wish to use the --yaml output options.

Fixes [YOCTO #3768].

(From OE-Core rev: 69caf24112c11609eb351bea09817029bca0ff2e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 14:46:10 +00:00
Bogdan Marinescu 9a9848d215 python-smartpm: multilib fixes
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).

[YOCTO #3681]

(From OE-Core rev: 05fd850f09c58dba8f64f3fe1de28ed9f21890a2)

(From OE-Core rev: 03c892a02568fa8a5765d9fb569a55f17ea05f96)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:03 +00:00
Bogdan Marinescu 54021c2a41 python-smartpm: add dependency on python-pprint
smart's "config" command uses the Python pprint module. If it is not
present, "config" fails with this error:

 #############
 # smart config --help
 error: Invalid command 'config'
 #############

This patch adds a dependency on python-pprint which fixes the error.
Tested on qemux86/core-image-sato-sdk.

[YOCTO #3643]

(From OE-Core rev: f5f9cfcccd1526572673ffbc5435bf3221498409)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-10 23:43:08 +00:00
Bogdan Marinescu 9ed113a1a8 python-smartpm: improve error reporting
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.

(From OE-Core rev: c29d9f8d61d45318d07ed6ccab7a3ec6d1c27037)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-19 17:55:01 +00:00
Mark Hatle e1345b76c0 rpm/smart: Fix runtime-relocation issues w/ RPM and Smart
Fix runtime-relocation issues with the RPM and Smart wrappers.

In addition the patches were necessary to fix related problems.
The changes to the includes three categories of issues:
  *) Incorrect pathname evaluations
  *) Incorrect evaluation of the /etc/rpm/platform file contents
  *) Confusing vendor #define checks

Finally, a simple way to debug the platformScore was added as
that is necessary to debug how this works and into the smart system.

(From OE-Core rev: 355a621caca66ed393d36fff6be8918921cf45ae)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 17:24:52 +00:00
Martin Jansa 49d58b3b9f python-smartpm: don't try to remove /usr/share/share twice
* distutils.bbclass now removes that directory

(From OE-Core rev: 5990bda7e0c21629ac5ecaa2ba9783af5a77a125)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>

Conflicts:
	meta/recipes-devtools/python/python-smartpm_1.4.1.bb
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:15 +00:00
Mark Hatle 2bc0834f85 python-smartpm: Fix incorrect comparison arguments
Built-in provides were not being compared properly within smart.
This was caused by an incorrect argument to the match function.

(From OE-Core rev: 81f8972323a0a89e67f5cc4be247bc8e1b637cc4)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:07 +00:00
Paul Eggleton b3744b7ead python-smartpm: allow setting arbitrary macros in smart config
Add support for an rpm-extra-macros config option which can be
used to define some extra macros that need to be set for rootfs
construction to work on the host and that don't really warrant
their own specific named config options to be created.

(From OE-Core rev: 0564f7bbe8e06868e107b70d5abbf3dd6c113bad)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:06 +00:00
Paul Eggleton 8d9ee074a4 python-smartpm: support nolinktos and noparentdirs rpm options
Allowing us to turn on these options enables installation of base-files
which contains a symlink to /proc/mounts which is auto-detected as a
dependency and isn't provided by any other package.

(From OE-Core rev: 1f0ad78b8fa739f9a68ed4c7bfae2b6d8586fda2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:06 +00:00
Paul Eggleton 4190b027b4 python-smartpm: don't create /var/tmp on every rpm database open
This directory if present in the rootfs interferes with proper
installation of base-files and doesn't seem to need to be there
for smart/rpm to work in any case.

(From OE-Core rev: 54d227e97ff3498fc2149f96f1ca40452ad21a32)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:06 +00:00
Paul Eggleton 81dded6e95 python-smartpm: fix package metadata not being read from rpm-md feeds
The XML indexes in rpm-md were being parsed incorrectly leading to the
package metadata (e.g. dependencies) not being read.

(From OE-Core rev: bb3abe241ae9d7e62e084cde383ebe1c6b95d825)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:06 +00:00
Paul Eggleton e60be76f43 python-smartpm: style fixes
* Use ${PN} instead of python-smartpm
* Use multi-line strings instead of multiple single line += (also
  avoiding the confusing "_append +=")
* Use class-native instead of virtclass-native - no difference in
  behaviour, but this keeps things consistent if we have to add
  any target overrides in future.

(From OE-Core rev: 7dbe5004380b97949a7910706364ba57c6c52a33)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:05 +00:00
Paul Eggleton 69b9c6bd0c python-smartpm: add support for recommends
Implement support within Smart for handling RRECOMMENDS relationships
between RPM packages as used by OE. This includes support within the
base system for caching and resolving these relationships as well as
specific support in the RPM backend for reading the information from
packages, and reading the "missingok" flag added to createrepo for
rpm-md feeds.

(From OE-Core rev: 35e3bc90ec3bae824804bd176b3128efdb5b4e2b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06 12:31:05 +00:00
Richard Purdie fe21ace36e python-smart-backend: Remove bogus runtime virtual/
At runtime virtual/ providers make *no* sense at all. They also break debian
packaging since the "/" character is not allowed in debian package names.

This patch removes this runtime provider selection code since it is not
workable and breaks builds.

(From OE-Core rev: 887059e9c0082cb4e7fa8b5d7c9646207acd62a6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-22 07:53:32 +00:00
Mark Hatle a0d1ac7999 python-smartpm: Add basic knowledge of RPMSENSE_MISSINGOK
Currently smart does not support recommend dependencies.  Add the first set
of 'support' for RPMSENSE_MISSINGOK (the flag that makes something a
recommend).  This initial support ends up ignoring the recommendation, but is
written in a way that it will be the basis of eventual support.

(From OE-Core rev: 4f1f6d39803c94cf9ff55f0a4616e7a1703bcef6)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18 16:42:03 +00:00
Mark Hatle 3d8fd40f9f python-smartpm: Add smartpm recipe
This is the initial integration, basic functionality such as 'smart query'
has been tested.  Active use of remote feeds and such has not yet been
verified.

Thanks to Paul Eggleton for corrections and bug fixes for the initial
integration.

(From OE-Core rev: 92182ca88aff9cec04b2af5e9babaf33bf61f0af)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18 16:42:02 +00:00