summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
Commit message (Collapse)AuthorAgeFilesLines
* package_manager.py: Explicit complementary failNiko Mauno2018-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running bitbake -c populate_sdk <image_name>, it is expected that packages matching SDKIMAGE_INSTALL_COMPLEMENTARY name mask (unless declared in PACKAGE_EXCLUDE_COMPLEMENTARY) are installed to resulting SDK. Underlying mechanism issues a package manager install call for set of complementary packages. However the mechanism doesn't seem to inform the user all too obviously in case the package manager command behind install_complementary() method fails -- and since it is combined with attempt_only=True option, user might end up wondering why several *-dev, *-dbg packages are missing from resulting SDK. Improve associated install() method behaviour in affected OpkgPM and DpkgPM classes so that a problematic state of affairs becomes directly obvious for bitbake user, resulting in shell output like: WARNING: someimage-1.0-r0 do_populate_sdk: Unable to install packages. Command '...' returned 1: Collected errors: * Solver encountered 1 problem(s): * Problem 1/1: * - package somepkg-dev-1.0-r0.x86 requires somepkg = 1.0-r0, but none of the providers can be installed * * Solution 1: * - allow deinstallation of someotherpkg-1.1-r1.x86 * - do not ask to install a package providing somepkg-dev * Solution 2: * - do not ask to install a package providing somepkg-dev (From OE-Core rev: 2502bd591c37bf532d02dc6b37fc1e8b5224fb0a) (From OE-Core rev: 88bbc4b84ce97f82d08c841edf25e6fc29d408b0) Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0d4459e7086fced5e9e0b4ad10378c9eddec56a8) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package-manager: add install_glob()Ross Burton2018-04-021-0/+23
| | | | | | | | | (From OE-Core rev: 8d1b530c82de386d4183f5673c060b9d416a3835) (From OE-Core rev: b9a7821086b5165fda9f1c8a7c79a7997803f2a6) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: improve install_complementaryRoss Burton2018-04-021-2/+2
| | | | | | | | | | | | - 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>
* lib/oe/package_manager/sdk: Ensure do_populate_sdk_ext and do_populate_sdk ↵Richard Purdie2018-01-221-2/+3
| | | | | | | | | | repos don't conflict (From OE-Core rev: c9c0927bb6e71253cbdd5b6b780dca829526e1d8) (From OE-Core rev: a18942b0b3b848ccfa4bc50c56a565c279da9d74) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Generate correct RPM package names againPeter Kjellerstedt2017-08-311-3/+3
| | | | | | | | | | | | | | | | 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>
* package_manager: Fix support for NO_RECOMMENDATONSRichard Röjfors2017-08-291-1/+1
| | | | | | | | | | | | | | | | 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>
* package_manager.py: set dnf's releasever setting from DISTRO_CODENAMEAlexander Kanavin2017-07-271-3/+5
| | | | | | | | | | | | | | | | | | | | 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>
* package_manager: flush installed_pkgs file before oe-pkgdata-util uses itMartin Jansa2017-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* package_manager.py: Reverse rpm arch orderJussi Kukkonen2017-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* package_manager: don't race on a file when installing complementary packagesRoss Burton2017-04-191-25/+22
| | | | | | | | | | | | | | | | | | 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>
* package_manager.py: Generate separate repo entries per archIan.Arkver2017-04-141-4/+11
| | | | | | | | | | | | | | 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>
* package_manager.py: Add a name for the generated dnf repo.Ian.Arkver2017-04-121-1/+1
| | | | | | | | | | | 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>
* package_manager.py: Split feed_archs for RPM repo URIsIan.Arkver2017-04-111-1/+1
| | | | | | | | | | | 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>
* package_manager.py: respect OPKGLIBDIRMartin Jansa2017-03-241-7/+14
| | | | | | | | | | | | | | | | | | | * 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>
* sign_rpm.bbclass: do not set/use RPM_GPG_PUBKEYAlexander Kanavin2017-03-231-1/+3
| | | | | | | | | | | | | 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>
* package_manager: fix "exlcude" vs. "exclude" typoPaul Gortmaker2017-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* dnf: add /usr/bin/dnf symlink that points to /usr/bin/dnf-2Alexander Kanavin2017-03-171-1/+1
| | | | | | | | | | | 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>
* lib/oe/package_manager: import rpm signing key to rpmdbMarkus Lehtonen2017-03-171-2/+10
| | | | | | | | | | | | | 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>
* rpm: add support for remote package feeds via PACKAGE_FEED_URIS variableAlexander Kanavin2017-03-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* rootfs_rpm.bbclass: migrate image creation to dnfAlexander Kanavin2017-03-141-971/+221
| | | | | | | | | 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>
* package_manager.py: improve the API for insert_feed_uris()Alexander Kanavin2017-03-141-19/+22
| | | | | | | | | | 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>
* classes: Drop now unneeded update_data callsRichard Purdie2017-02-151-2/+0
| | | | | | | | | | 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>
* package_manager: default to have scriptlet output captured in logChen Qi2017-01-231-5/+6
| | | | | | | | | | | | | | | | 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>
* lib/oe/package_manager.py: Fix extract for ipk and debMariano Lopez2017-01-191-1/+5
| | | | | | | | | | | | 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>
* meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie2017-01-091-4/+2
| | | | | | | | | | | | | | | | | 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>
* lib/oe/package_manager: bail if createrepo can't be foundRoss Burton2016-12-171-1/+5
| | | | | | | | | | | | 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>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-87/+87
| | | | | | | | | | | | | 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>
* package_manager: remove strings and migrate to direct arraysStephano Cetola2016-12-081-119/+114
| | | | | | | | | | | | | | 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>
* lib/oe/package_manager: .deb pre/postinst argsLinus Wallgren2016-11-231-6/+11
| | | | | | | | | | | | | | | | 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>
* package_manager.py: correctly remove all dependent packagesSamuli Piippo2016-11-061-1/+1
| | | | | | | | | | | 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>
* package_manager.py: Allow multiple regexps in PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* package_manager.py: Allow a leading - in PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* package_manager.py: Change diagnostic messages per IRCMark Hatle2016-09-201-8/+12
| | | | | | | | | | | | | 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>
* package_manager.py: Adjust error message orderMark Hatle2016-09-201-4/+4
| | | | | | | | | | | | 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>
* package_manager.py: fix bitbake package-index failedHongxu Jia2016-09-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Allow for simultaneous do_rootfs tasks with rpmuninative-1.3Stephano Cetola2016-08-121-3/+14
| | | | | | | | | | | | | | | | | | | | | | 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>
* package_manager.py: Avoid installing an empty package listMark Hatle2016-07-211-0/+3
| | | | | | | | | | | | | | | 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>
* lib/oe/package_manager: keep platform_extra and default_platform_extra lists ↵Bill Randle2016-07-011-6/+7
| | | | | | | | | | | | | | | | | | 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>
* package_manager.py: specify tmpdir for opkgChen Qi2016-06-231-1/+1
| | | | | | | | | | | | | | | 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>
* package_manager: Fix multilib package arch ordering issuesRichard Purdie2016-06-211-8/+4
| | | | | | | | | | | | | | | | | | | | | 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>
* oe/lib/pacakge_manager.py: Update missing pipeline decodingMariano Lopez2016-06-071-2/+2
| | | | | | | | | | | | 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>
* lib/oe/package_manager: adapt for Python 3Ross Burton2016-06-051-2/+2
| | | | | | | | | | 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>
* classes/lib: Complete transition to python3Richard Purdie2016-06-021-8/+3
| | | | | | | | | 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>
* classes/lib: Update to explictly create lists where neededRichard Purdie2016-06-021-3/+3
| | | | | | | | | 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>
* classes/lib: Update to use python3 command pipeline decodingRichard Purdie2016-06-021-43/+45
| | | | | | | | | | | 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>
* classes/lib: Convert to use python3 octal syntaxRichard Purdie2016-06-021-2/+2
| | | | | | | | 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>
* lib/oe/package_manager.py: Add pkgpath to dict returned by package_infoMariano Lopez2016-05-301-17/+24
| | | | | | | | | | | | | | 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>
* package_manager: no need to output Note: in bb.note() callsRoss Burton2016-05-221-8/+8
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager.py: Add extract() method for RPM package managerMariano Lopez2016-05-141-0/+85
| | | | | | | | | | | | 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>
* package_manager.py: Add extract() method for opkg and dpkgMariano Lopez2016-05-141-6/+134
| | | | | | | | | | | | | | | | | | 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>