Commit Graph

148 Commits

Author SHA1 Message Date
Ross Burton 9248da456e package_manager: improve install_complementary
- No need to use bb.utils.which() as subprocess will search $PATH
- Clarity flow by moving the install inside the try/except

(From OE-Core rev: f4d22b7195dd8f08fe26dd353c7e860208e87d6a)

(From OE-Core rev: 1267df89164d7dcbbf77668ac49452bd0df87b54)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-02 17:06:24 +01:00
Richard Purdie 75883f84c8 lib/oe/package_manager/sdk: Ensure do_populate_sdk_ext and do_populate_sdk repos don't conflict
(From OE-Core rev: c9c0927bb6e71253cbdd5b6b780dca829526e1d8)

(From OE-Core rev: a18942b0b3b848ccfa4bc50c56a565c279da9d74)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-22 10:40:08 +00:00
Peter Kjellerstedt 01406f8bf6 package_manager.py: Generate correct RPM package names again
During the transition to RPM4, the package names returned by
RpmPM.list_installed() changed from the expected names of the packages
that were installed into the image to some fictitious source RPM
names.

This restores the original functionality so that the
installed-packages.txt files produced by inheriting buildhistory yet
again contains a list of the names of the installed packages.

(From OE-Core rev: cd982d5b8944fe231c7dd38c9a563d0fc0737b88)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31 17:57:11 +01:00
Richard Röjfors 2002de4eae package_manager: Fix support for NO_RECOMMENDATONS
When support for dnf was introduced the check of the
no NO_RECOMMENDATIONS variable got broken.

This fixes the issue by compairing to the string "1"
rather than the number 1.

(From OE-Core rev: 5f9ea84d304a519acb0504516b86f2683a43f9e9)

Signed-off-by: Richard Röjfors <richard@puffinpack.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 1849ce3bd7c0af055f3e849a6508e746b6a0dca5)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-29 11:57:28 +01:00
Alexander Kanavin d4c4708906 package_manager.py: set dnf's releasever setting from DISTRO_CODENAME
So that:

1) dnf does not complain anymore about releasever not being set and then fail
for the same reason;

2) it's possible to refer to $releasever in dnf package feed configuration
(repo paths in particular) without hardconding the release name (pyro, morty, etc.)

(From OE-Core rev: 789e3fc225adbb61f10aaa3bbc3677856f5f0238)

(From OE-Core rev: 5a97694767c76f3083e9ffeeaaa19d76ff424c83)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27 22:36:44 +01:00
Martin Jansa 185f4e7e6e package_manager: flush installed_pkgs file before oe-pkgdata-util uses it
* since this commit:
  commit f5a1013ffa9815f22e13989e2bcb83f966e7ce2c
  Author: Ross Burton <ross.burton@intel.com>
  Date:   Tue Apr 18 16:19:12 2017 +0100

    package_manager: don't race on a file when installing complementary
    packages

  the file isn't closed before oe-pkgdata-util uses it and this
  temporary file might look empty to oe-pkgdata-util, because it
  wasn't flushed yet. Which resulted in almost empty debugfs tarballs
  and no locale packages in regular rootfs.
* without this change:
  124K May 30 07:41 core-image-full-cmdline-raspberrypi3-64-20170530054003-dbg.rootfs.tar.gz
* with this change:
  173M May 30 07:29 core-image-full-cmdline-raspberrypi3-64-20170530052715-dbg.rootfs.tar.gz

(From OE-Core rev: 9b34200048b3d2b477a19b7ddc8d447f873adbb2)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 877d38db08aa7060d16405443cf70539c559fe82)
Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07 09:19:08 +01:00
Jussi Kukkonen adea8003ab package_manager.py: Reverse rpm arch order
The architecture list used by dnf/libsolv was in the wrong order.
As a result, the images were built with wrong and unpredictable
packages.

$ MACHINE=intel-corei7-64 bitbake core-image-sato
$ MACHINE=qemux86-64 bitbake core-image-sato
$ MACHINE=intel-corei7-64 bitbake -ccleansstate core-image-sato
$ MACHINE=intel-corei7-64 bitbake core-image-sato

The first image had 0 core2_64 packages in it, but the last one had
583 core2_64 packages (which were built for the qemu image in
between).

Reverse the arch order in etc/dnf/vars/arch.

Fixes [YOCTO #11384].

(From OE-Core rev: 4a82433de42943f8219beca3286f40b67157172f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-20 07:55:25 +01:00
Ross Burton ae5d643114 package_manager: don't race on a file when installing complementary packages
PackageManager.install_complementary() uses WORKDIR/installed_pkgs.txt as a
temporary file but if two tasks are executing for the same recipe which uses
this file (e.g. bitbake my-image my-image:do_populate_sdk) then it's possible
for the file to be overwritten or deleted.

Instead of using a static filename, use tempfile to generate a unique name and
ensure it is cleaned up when finished.

Also move the glob generation/expansion earlier in the function as if there are
no globs to install, we don't need to generate a package list.

(From OE-Core rev: f5a1013ffa9815f22e13989e2bcb83f966e7ce2c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-19 10:18:43 +01:00
Ian.Arkver 2bc2e67dd0 package_manager.py: Generate separate repo entries per arch
dnf requires a serparate repo for each architecture. This patch
writes one config file per PACKAGE_FEED_URIS entry with an entry
for each architecture, if any.

It also uses a space separated version of the repo id as the repo
name instead of just the id again.

(From OE-Core rev: 3eed822b5c5661aa9f43af6582c1481bacf0d39a)

Signed-off-by: Ian.Arkver <ian.arkver.dev@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-14 09:47:08 +01:00
Ian.Arkver f2e41a197f package_manager.py: Add a name for the generated dnf repo.
This adds repo_name as the name, which is the same as the
repo ID and hence a bit pointless, but it stops dnf from
complaining that the repo doesn't have a configured name.

(From OE-Core rev: c92cff23893e87cfb7ef9f77b16761310104543a)

Signed-off-by: Ian.Arkver <ian.arkver.dev@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-12 15:09:58 +01:00
Ian.Arkver ae65b95354 package_manager.py: Split feed_archs for RPM repo URIs
By default the feed_archs variable is split into single characters
resulting in very many broken short repo_uris. Add a split() to
split the string into words first.

(From OE-Core rev: 7bd6a4d56c08bf7f9ced7c07327e6163216fee08)

Signed-off-by: Ian.Arkver <ian.arkver.dev@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 18:10:17 +01:00
Martin Jansa fcbad38193 package_manager.py: respect OPKGLIBDIR
* respect it for incremental rootfs generation
* add lists_dir option to opkg.conf
* also fix setting info_dir and status_file when they use default value, the
  problem is that self.opkg_dir is already prefixed with rootfs directory,
  comparing it with /var/lib/opkg always returned false and the options were
  appended to config file unnecessary
* with opkg 0.3.4 we can use VARDIR prefix added in:
  commit d2a8e23dc669adc398f4bb8bcfcabfcf925708f7
  Author: Florin Gherendi <floring2502@gmail.com>
  Date:   Mon Dec 19 12:25:38 2016 +0200
  libopkg: make the /var and /etc directories configurable at compile time.

(From OE-Core rev: b14c11d062872c3dcf95e03b61017005dea5b754)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:32 +00:00
Alexander Kanavin 4581e2c3e6 sign_rpm.bbclass: do not set/use RPM_GPG_PUBKEY
This is entirely unnecessary (we can ask the signer backend to export the
key to a file when needed), and was causing confusing selftest failures
due to the variable being set from two different places.

[YOCTO #11191]

(From OE-Core rev: 74ea979044368dc28c24325e7e77471b70aa8fe8)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Paul Gortmaker 52d2faad9f package_manager: fix "exlcude" vs. "exclude" typo
Which results in:

 --------------------------------
      0557:        package_exclude = self.d.getVar('PACKAGE_EXCLUDE')
  *** 0558:        exclude_pkgs = (bad_recommendations.split() if bad_recommendations else []) + (package_exlcude.split() if package_exclude else [])
      0559:
      0560:        output = self._invoke_dnf((["--skip-broken"] if attempt_only else []) +
      0561:                         (["-x", ",".join(exclude_pkgs)] if len(exclude_pkgs) > 0 else []) +
      0562:                         (["--setopt=install_weak_deps=False"] if self.d.getVar('NO_RECOMMENDATIONS') == 1 else []) +
 Exception: NameError: name 'package_exlcude' is not defined
 ERROR: cube-builder-initramfs-1.0-r0 do_rootfs: Function failed: do_rootfs
 ---------------------------------

Cc: Alexander Kanavin <alexander.kanavin@linux.intel.com>
(From OE-Core rev: cee1bdc09f4bbfedcd7cac06b48ba9d195c29e62)

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:04 +00:00
Alexander Kanavin aa66e8782e dnf: add /usr/bin/dnf symlink that points to /usr/bin/dnf-2
All documentation refers to dnf binary as 'dnf' yet make install
does not create one - it's done by Fedora's spec file when building
the rpm. Let's replicate this behavior.

(From OE-Core rev: 456c4a8ffc9a292d7a3e036d92baf4a8f14d1f45)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:04 +00:00
Markus Lehtonen 9a548edb0f lib/oe/package_manager: import rpm signing key to rpmdb
Import the gpg key used in rpm signing into rpmdb. This makes it
possible again to create images when rpm signing is enabled.

Also, instruct dnf to enforce signature check if rpm signing is enabled.

(From OE-Core rev: f30c1653cc5ef9daf594cbd3faad329b9fa08ab7)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:04 +00:00
Alexander Kanavin 2b77735c72 rpm: add support for remote package feeds via PACKAGE_FEED_URIS variable
I've used a previous patch (which was never merged) by
Humberto Ibarra <humberto.ibarra.lopez@intel.com> as a model
for how to do runtime testing of this feature (e.g. we need to boot
an image, run dnf on it, and check that it is indeed able to
access the remote repo over http). Here's his original commit message:

=====
Testing that feeds specified with PACKAGE_FEED_URIS var are set
correctly has two parts. First a build with this var set is required,
and then smart update needs to be issued in the running taget.

The previous is not a common selftest practice because this is a
simple test, but requires building and running a specific image,
which takes a lot of time. testimage is not a good fit either,
since the images tested there do not have the PACKAGE_FEED_URIS
var set.

For this test, the runtime-test module is being used, which is a
selftest module but runs a testimage command. The var and test
environment were set in runtime-perf.py and the actual test is
done in a new testcase added to meta-selftest layer.
=====

[YOCTO #10872]

(From OE-Core rev: 3a9e2fdef9316e24b52ce99ac355fc2b09786c72)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:04 +00:00
Alexander Kanavin 67615e0175 rootfs_rpm.bbclass: migrate image creation to dnf
To properly look at this patch, you probably need a side-by-side diff viewing tool.

(From OE-Core rev: 65581c68d130fa74d703f6c3c92560e053857ac7)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin b9c550dd6e package_manager.py: improve the API for insert_feed_uris()
No need to store the configuration as class members,
just pass it directly into the method.

(From OE-Core rev: a5cc38481be3c5e6ccbecf951f9fdc049e5101d5)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Chen Qi 2a64701acf package_manager: default to have scriptlet output captured in log
We need to have scriptlet output captured in log. If we don't do so,
some useful information from scriptlets (especially postinstall script)
would be missing. In case a script has a warning message but it does not
necessarily have to fail, the message should be captured.

Opkg has already done that. Change for rpm and dpkg so that scriptlet
output is captured and no warning message is missing.

(From OE-Core rev: 0e52e0c619e02327602d83999a61d978d3a9240e)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:22 +00:00
Mariano Lopez 55aa669750 lib/oe/package_manager.py: Fix extract for ipk and deb
With the move to use lists instead of strings in subprocess
calls, package extraction was broken for ipk and deb. This
fixes this issue.

(From OE-Core rev: 3e1d8e5c7ac3238eda85ee95dfef044bef2a6411)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Ross Burton de43650c29 lib/oe/package_manager: bail if createrepo can't be found
If createrepo isn't found then the errors later are mysterious, so explicitly
check and error out early if it isn't there.

(From OE-Core rev: e09636bbb3ea8ec58984197fd9c691bb908efe00)

(From OE-Core rev: c87361fc886432a9db584712bf3e41ecd0541960)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-17 09:57:04 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Stephano Cetola d8fbaebc48 package_manager: remove strings and migrate to direct arrays
When using subprocess call and check_output, it is better to use arrays
rather than strings when possible to avoid whitespace and quoting
problems.

[ YOCTO #9342 ]

(From OE-Core rev: b12cec9a5ef14ecb02be7feec65508cf5d65c795)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Linus Wallgren b91e47fccb lib/oe/package_manager: .deb pre/postinst args
The debian policy manual and MaintainerScripts wiki page states that the
postinst script is supposed to be called with the `configure` argument
at first install, likewise the preinst script is supposed to be called
with the `install` argument on first install.

https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
https://wiki.debian.org/MaintainerScripts

(From OE-Core rev: 3d9c3aae54589794ce3484fa1b21d1af2bd32661)

Signed-off-by: Linus Wallgren <linus.wallgren@scypho.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:11 +00:00
Samuli Piippo b18901d9bc package_manager.py: correctly remove all dependent packages
Do not use --force-depends when trying to remove all dependent packages,
as it removes only the selected package and not the dependent packages.

(From OE-Core rev: a82e8725902086dab785a0b14305927dae1e4e8d)

Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:33 +00:00
Peter Kjellerstedt d067b0e1e4 package_manager.py: Allow multiple regexps in PACKAGE_EXCLUDE_COMPLEMENTARY
The PACKAGE_EXCLUDE_COMPLEMENTARY variable can currently only contain
one regular expression. This makes it hard to add to it from different
configuration files and recipes.

Allowing it to contain multiple, whitespace separated regular
expressions should be backwards compatible as it is assumed that
whitespace is not used in package names and thus is not used in any
existing instances of the variable.

After this change, the following three examples should be equivalent:

  PACKAGE_EXCLUDE_COMPLEMENTARY = "foo|bar"

  PACKAGE_EXCLUDE_COMPLEMENTARY = "foo bar"

  PACKAGE_EXCLUDE_COMPLEMENTARY = "foo"
  PACKAGE_EXCLUDE_COMPLEMENTARY += "bar"

(From OE-Core rev: a5f7e98a94e96d40b1276c85249619aa8d7be847)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 07:51:00 +01:00
Peter Kjellerstedt 2334201960 package_manager.py: Allow a leading - in PACKAGE_EXCLUDE_COMPLEMENTARY
This allows a regular expression specified in
PACKAGE_EXCLUDE_COMPLEMENTARY to have a leading dash. Without this,
the dash was treated by oe-pkgdata-util as the beginning of a command
line argument. E.g., if PACKAGE_EXCLUDE_COMPLEMENTARY = "-foo$", it
resulted in an error like:

  ERROR: <imagename>-1.0-r0 do_populate_sdk: Could not compute
  complementary packages list. Command '<topdir>/scripts/oe-pkgdata-util -p
  <builddir>/tmp/sysroots/<machine>/pkgdata glob
  <workdir>/installed_pkgs.txt *-dev *-dbg -x -foo$' returned 2:
  ERROR: argument -x/--exclude: expected one argument
  usage: oe-pkgdata-util glob [-h] [-x EXCLUDE] pkglistfile glob [glob ...]

(From OE-Core rev: ac4ca41d3a27356d46c0c39053e74d3519b24c44)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 07:51:00 +01:00
Mark Hatle 0a04692279 package_manager.py: Change diagnostic messages per IRC
Based on a discussion with IRC user: Ulfalizer

It was suggested that removing the diagnostic list, and replacing it with a
simple hint to what might be causing the problem was a better solution.

(From OE-Core rev: ca78313665b23bd7fee85f034acfe1eb1009bd65)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:08 +01:00
Mark Hatle f1e3dc029f package_manager.py: Adjust error message order
Move the debug before the error (as it can take many pages.)  This makes it
much easier for the user to see the actual error message as it is still on
the screen.

(From OE-Core rev: d643fb2a9cb5bd0d8b0105e9d44b989a49ffa963)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:08 +01:00
Hongxu Jia 06e56abbd2 package_manager.py: fix bitbake package-index failed
Previously the following commit in oe-core move RPM metadata
from DEPLOY_DIR to WORKDIR.
-----------
commit a92c196449c516fe51786d429078bbb1213bb029
Author: Stephano Cetola <stephano.cetola@linux.intel.com>
Date:   Wed Aug 10 13:03:16 2016 -0700

    Allow for simultaneous do_rootfs tasks with rpm

    Give each rootfs its own RPM channel to use.  This puts the RPM metadata
    in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR
    where other tasks may race with it.
-----------

In the modification of 'class RpmIndexer, it should not
directly set arch_dir with WORKDIR. It caused 'bitbake
package-index' could not work correctly.

Assign WORKDIR as input parameter at RpmIndexer initial time
could fix the issue.

(From OE-Core rev: 3c8c8501d0a19b566a94a9e06afe40642b444958)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:02 +01:00
Stephano Cetola 6b66e9317f Allow for simultaneous do_rootfs tasks with rpm
Give each rootfs its own RPM channel to use.  This puts the RPM metadata
in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR
where other tasks may race with it.

This allows us to reduce the time that the rpm.lock is held to only the
time needed to hardlink the RPMs, allowing the majority of the rootfs
operation to run in parallel.

Also, this fixes the smart tests by generating an index for all packages
at the time of the test, rather than using the one provided by the
rootfs process.

Original credit for the enhancement should go to Steven Walter
stevenrwalter@gmail.com.

(From OE-Core rev: a92c196449c516fe51786d429078bbb1213bb029)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-12 15:25:22 +01:00
Mark Hatle d183d1e08b package_manager.py: Avoid installing an empty package list
It is possible in an attempt only install, that everything listed is not
available to be installed.  This will have the effect of clearing the
package list.  However, we only check for an empty package list at
the beginning of the function.  We need to also check before running the
install, otherwise we can fail due to 'error: no package(s) given".

(From OE-Core rev: 9ae6a2830dacb3c335754a6da91bd5cc30546b31)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Bill Randle 58643b74ee lib/oe/package_manager: keep platform_extra and default_platform_extra lists ordered
In RpmPM:insert_feeds_uris, the paths are kept in sets, which are unordered,
but they are later used to set the priority for the Smart channels, so
unexpected results could occur. Change the sets to lists and use the same
code as in create_configs() to add items to the list, rather than the set
operators.

[YOCTO #9717]

(From OE-Core rev: ce4137f4bb955207fede0c4ef338835d9a461f59)

Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:45 +01:00
Chen Qi c2acd4e27d package_manager.py: specify tmpdir for opkg
Specify tmpdir for opkg via '-t' option so that opkg does not use
the default 'TMPDIR' which usually is '/tmp' on build host.

This would solve race problems like below.

  sh: /tmp/opkg-rOG6Tl/opkg-intercept-iPoEp5/depmod: Permission denied

(From OE-Core rev: 5665e284b7e7ee071201664dc50a3412bd4ac8cd)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Richard Purdie e6d26f5dbc package_manager: Fix multilib package arch ordering issues
Order is not preserved in dict() and this code depends on the order of
these lists of package architectures used when multilibs are enabled.
This caused 'random' breakage where sometimes the correct order was present
and sometimes it wasn't.

Use collections.OrderedDict() to avoid this problem.

Kudos to Bill Randle and Alejandro Hernandez who did most of the work debugging
this, I simply took the problem they identified and wrote a patch to fix it.

This unblocks the M1 build but this code needs auditing as there are clearly
other ordering issues (e.g. the set() usage).

[YOCTO #9717]

(From OE-Core rev: 61a33582dfc964d612d20d34734a787d873e312c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-21 12:58:40 +01:00
Mariano Lopez 84441a96f0 oe/lib/pacakge_manager.py: Update missing pipeline decoding
Adds decoding needed by some commands output later used as
strings.

[YOCTO #9702]

(From OE-Core rev: 0440b5ace411c61f802376d4e1c9eac93e72d65f)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-07 15:22:38 +01:00
Ross Burton 6c5d7f1fb2 lib/oe/package_manager: adapt for Python 3
string.rstrip() doesn't exist in Python 3, so use the .rstrip method on the
object itself instead.

(From OE-Core rev: 554719e3f65e468f89a96d4869766d3ff7a8012e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-05 23:39:47 +01:00
Richard Purdie 3b39971748 classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to
python3 which didn't make sense to be broken into individual patches.

(From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:01 +01:00
Richard Purdie 44e9a0d2fa classes/lib: Update to explictly create lists where needed
Iterators now return views, not lists in python3. Where we need
lists, handle this explicitly.

(From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Richard Purdie a7309d5790 classes/lib: Update to use python3 command pipeline decoding
In python3, strings are unicode by default. We need to encode/decode
from command pipelines and other places where we interface with the
real world using the correct locales. This patch updates various
call sites to use the correct encoding/decodings.

(From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Richard Purdie 297438e965 classes/lib: Convert to use python3 octal syntax
The syntax for octal values changed in python3, adapt to it.

(From OE-Core rev: 737a095fcde773a36e0fee1f27b74aaa88062386)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Mariano Lopez 0f64a717d2 lib/oe/package_manager.py: Add pkgpath to dict returned by package_info
Having the package path with all the other package info allows to
reuse more code and have this information outside the package manager,
without additional processing.

[YOCTO #8536]

(From OE-Core rev: 343f762792cbfccffaf3aa901289f9bb0f8cef3d)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30 15:58:13 +01:00
Ross Burton 13df45b74e package_manager: no need to output Note: in bb.note() calls
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-22 16:11:13 +01:00
Mariano Lopez 0ff3f495ca package_manager.py: Add extract() method for RPM package manager
This new method extract the content of RPM file to a tmpdir,
without actually installing the package.

[YOCTO #9569]

(From OE-Core rev: 5f5c2a0fac5ad2baca162902410064375e8c610c)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:11 +01:00
Mariano Lopez b372a82818 package_manager.py: Add extract() method for opkg and dpkg
Sometimes it is needed to have the content of a package outside
the recipe context.  This new method extract the content of an
IPK/DEB file to a tmpdir, without actually installing the package.

A new OpkgDpkgPM class was added to share the code for opkg and dpkg.

There were need some changes to opkg_query() in order to use it
with apt-cache output. Also set default values to avoid UnboundLocalError

[YOCTO #9569]

(From OE-Core rev: 7d214b34e11dc57316ed5c1c7747c4601286f6d2)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:11 +01:00
Mariano Lopez c5aa5246e0 package_manager.py: Move opkg_query() outside of Indexer class
When using the opkg and apt-get package managers the function
opkg_query() can be useful when query for package information.

This change moves the function outside the Indexer class so
the Indexer, OpkgPM, DpkgPM can benefit from it.

[YOCTO #9569]

(From OE-Core rev: 799bc1d1c747aad02b6d844bf55abfbd3ecc034c)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:11 +01:00
Patrick Ohly 21e31c2771 package_manager.py: better error handling in opkg's package listing
opkg does not return a non-zero exit code even if it found
errors. When that happens, parsing the output leads to strange
follow-up errors.

To avoid this we need to check explicitly for non-empty
stderr. Reporting only that on a failure also leads to shorter error
messages (stdout may be very large).

(From OE-Core rev: 7d9e915224a9bc451fddfbbfad533d9b06e9987d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05 14:33:58 +01:00