aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
AgeCommit message (Collapse)Author
2017-03-13rootfs_rpm.bbclass: migrate image creation to dnfAlexander Kanavin
To properly look at this patch, you probably need a side-by-side diff viewing tool. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-03-13package_manager.py: improve the API for insert_feed_uris()Alexander Kanavin
No need to store the configuration as class members, just pass it directly into the method. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
2017-02-15classes: Drop now unneeded update_data callsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23package_manager: default to have scriptlet output captured in logChen Qi
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. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-19lib/oe/package_manager.py: Fix extract for ipk and debMariano Lopez
With the move to use lists instead of strings in subprocess calls, package extraction was broken for ipk and deb. This fixes this issue. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-06meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie
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). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-17lib/oe/package_manager: bail if createrepo can't be foundRoss Burton
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) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-08package_manager: remove strings and migrate to direct arraysStephano Cetola
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 ] Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-23lib/oe/package_manager: .deb pre/postinst argsLinus Wallgren
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 Signed-off-by: Linus Wallgren <linus.wallgren@scypho.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-06package_manager.py: correctly remove all dependent packagesSamuli Piippo
Do not use --force-depends when trying to remove all dependent packages, as it removes only the selected package and not the dependent packages. Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-05package_manager.py: Allow multiple regexps in PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt
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" Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05package_manager.py: Allow a leading - in PACKAGE_EXCLUDE_COMPLEMENTARYPeter Kjellerstedt
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 ...] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20package_manager.py: Change diagnostic messages per IRCMark Hatle
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. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-20package_manager.py: Adjust error message orderMark Hatle
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. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-16package_manager.py: fix bitbake package-index failedHongxu Jia
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. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-11Allow for simultaneous do_rootfs tasks with rpmStephano Cetola
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. Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21package_manager.py: Avoid installing an empty package listMark Hatle
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". 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-01lib/oe/package_manager: keep platform_extra and default_platform_extra lists ↵Bill Randle
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] Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-23package_manager.py: specify tmpdir for opkgChen Qi
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 Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-21package_manager: Fix multilib package arch ordering issuesRichard Purdie
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-06oe/lib/pacakge_manager.py: Update missing pipeline decodingMariano Lopez
Adds decoding needed by some commands output later used as strings. [YOCTO #9702] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-05lib/oe/package_manager: adapt for Python 3Ross Burton
string.rstrip() doesn't exist in Python 3, so use the .rstrip method on the object itself instead. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Complete transition to python3Richard Purdie
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to explictly create lists where neededRichard Purdie
Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to use python3 command pipeline decodingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Convert to use python3 octal syntaxRichard Purdie
The syntax for octal values changed in python3, adapt to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30lib/oe/package_manager.py: Add pkgpath to dict returned by package_infoMariano Lopez
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-22package_manager: no need to output Note: in bb.note() callsRoss Burton
2016-05-14package_manager.py: Add extract() method for RPM package managerMariano Lopez
This new method extract the content of RPM file to a tmpdir, without actually installing the package. [YOCTO #9569] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14package_manager.py: Add extract() method for opkg and dpkgMariano Lopez
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14package_manager.py: Move opkg_query() outside of Indexer classMariano Lopez
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05package_manager.py: better error handling in opkg's package listingPatrick Ohly
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). Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20lib/package_manager: remove RPM4 support codeJoshua Lock
Simplify the RPM code by removing support for RPM 4 now that we've dropped the RPM 4 recipe. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-12package_manager.py: Fix race condition in OpkgIndexer.write_index()Mariano Lopez
When writing the index using ipk packages there could be a race condition when populate the index. This happens because the architectures are repeated (specially all) and the commands generated to write the index run in parallel. This change avoid the duplication of commands using a set instead of a list. [YOCTO #8924] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11sign_package_feed: add feed signature typeIoan-Adrian Ratiu
Signing package feeds will default to ascii armored signatures (ASC) the other option being binary (BIN). This is for both rpm and ipk backends. Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11package_manager: sign IPK package feedsIoan-Adrian Ratiu
Create gpg signed ipk package feeds using the gpg backend if configured Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09rpm: Uprev to rpm-5.4.16 (pre) and rpm-5.4+cvs to current CVS headMark Hatle
meta/lib/oe/package_manager.py was also updated. This ensures that any diagnostic messages are ignored from the output of rpmresolve. The patches have been split into bug fixes (things that belong upstream) and local changes that are OE specific. The following patches are obsolete and have been removed: rpm-remove-sykcparse-decl.patch fstack-protector-configure-check.patch rpm-disable-Wno-override-init.patch rpm-lua-fix-print.patch rpm-rpmpgp-fix.patch verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-02-26signing-keys: Make signing keys the only publisher of keysRandy Witt
Previously the keys were put into the os-release package. The package indexing code was also deploying the keys rather than only using the keys. This change makes signing-keys.bb the only publisher of the keys and also uses standard tasks that already have sstate. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18sign_rpm.bbclass: do not store key details in signer instanceMarkus Lehtonen
Refactor the LocalSigner class. Do not store keyid or passphrase file in the signer object as they are only needed for some of the methods. For example, the newly added verify() method does not need any key parameters and export_pubkey only uses keyid. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-06package_manager.py: fix python indentation bug (opkg)Ioan-Adrian Ratiu
This if branch is causing the following error during do_rootfs: "Exception: UnboundLocalError: local variable 'cfg_file' referenced before assignment". This happends because the cfg_file variable is defined at a deeper nesting level (just above the if branch). Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-31lib/oe/package_manager: remove package feed listsStefan Agner
Remove opkg package feed lists after generating the rootfs. The lists have been generated by the local feed but are no longer necessary after image generation. This still leaves the package management fully usable (and hence is different from omitting package-management from IMAGE_FEATURES). Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26meta/lib: new module for handling GPG signingMarkus Lehtonen
Add a new Python module (oe.gpg_sign) for handling GPG signing operations, i.e. currently package and package feed signing. The purpose is to be able to more easily support various signing backends and to be able to centralise signing functionality into one place (e.g. package signing and sstate signing). Currently, only local signing with gpg is implemented. [YOCTO #8755] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-22lib/oe/package_manager: prevent testing an undefined variableJoshua Lock
This prevents an error in do_populate_sdk when building buildtools-tarball with ipk as the package manager: Exception: UnboundLocalError: local variable 'pkg' referenced before assignment Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20lib/oe/package_manager.py: Remove list() from PkgsList classMariano Lopez
Now that the method list() is not used anymore, remove it. [YOCTO #7427] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-20lib/oe/rootfs: Use list_pkgs() instead of list()Mariano Lopez
This patch changes the use list_pkgs() instead of list() from class RpmPkgsList. The change is in two functions, image_list_installed_packages from rootfs.py and sdk_list_installed_packages from sdk.py. With this change the functions calling the functions listed above, must format the output as they required. The formatting can be done using format_pkg_list() from oe.utils. The classes calling the afected functions are changed too with this patch, to keep the same functionality using the new data structure. [YOCTO #7427] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-20lib/oe/package_manager: Add list_pkgs() to PkgsList classMariano Lopez
Currently the class PkgList returns a formated string of the installed packages. It would be more clean to pass a standard data structure to the callers instead to format the output inside PkgsList class. This patch adds list_pkgs() method to PkgsList class to get the all the information for installed packages and return a dictionary with the info. [YOCTO #7427] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-11package_manager.py: fixes for multilib deb packaging buildsMatt Madison
* tmp/deploy/deb subdirectories do not get hyphens replaced with underscores, so don't do that translation when building the sources list. * Fix MULTILIB_VARIANTS handling to be more general and work for all architectures * Also include a fix for a warning generated by apt due to missing apt/preferences.d directory. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-27package_manager.py: add debugging support for rpm scriptlet executionPatrick Ohly
By default, smart is invoked with --log-level=warning, which hides all output from pre/post install scriptlets. That makes it hard to debug scriptlet failure or why they get postponed to first-boot via /etc/rpm-postinst. The new ROOTFS_RPM_DEBUG variabled is expected to be set to an integer in local.conf an incrementally adds more output: 0 = default, only warnings 1 = --log-level=info (includes information about executing scriptlets and their output) 2 = --log-level=debug 3 = --log-level=debug plus dumps of scriplet content and command invocation The default behavior is not changed yet, but it seems that level 1 would be a better default. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-09lib/oe/package_manager: Introducing PACKAGE_FEED_BASE_PATHS/PACKAGE_FEED_ARCHSLeonardo Sandoval
The recently introduced PACKAGE_FEED_PREFIX is not flexible enough for constructing URIs, because the same PREFIX is used for all PACKAGE_FEED_URIS. Also, the string 'PREFIX' is confusing because it is not at the beginning of the URI. The variable PACKAGE_FEED_BASE_PATHS replaces PACKAGE_FEED_PREFIX, allowing multiple base paths to be appended on each PACKAGE_FEED_URIS. In the other hand, a new variable called PACKAGE_FEED_ARCHS, similar in concept to PACKAGE_BASE_PATHS, defines package architectures defined by the user. To demonstrate the usage of the PACKAGE_FEED_URIS, PACKAGE_FEED_BASE_PATHS and PACKAGE_FEED_ARCHS, let's assume these variables are set on local.conf PACKAGE_FEED_URIS = "https://example.com/packagerepos/release \ https://example.com/packagerepos/updates" PACKAGE_FEED_BASE_PATHS = "rpm rpm-dev" PACKAGE_FEED_ARCHS = "all core2-64" the resulting feeds would be https://example.com/packagerepos/release/rpm/all https://example.com/packagerepos/release/rpm/core2-64 https://example.com/packagerepos/release/rpm-dev/all https://example.com/packagerepos/release/rpm-dev/core2-64 https://example.com/packagerepos/updates/rpm/all https://example.com/packagerepos/updates/rpm/core2-64 https://example.com/packagerepos/updates/rpm-dev/all https://example.com/packagerepos/updates/rpm-dev/core2-64 Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>