summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-alternatives.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* classes: Update classes to match new bitbake class scope functionalityRichard Purdie2022-08-121-333/+0
| | | | | | | | | Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Add SPDX license identifiersRichard Purdie2022-08-121-0/+2
| | | | | | | | | | | | As stated in our top level license files, the license is MIT unless otherwise stated. Add SPDX identifers accordingly. Replace older license statementa with the standardised syntax. Also drop "All Rights Reserved" expression as it isn't used now, doesn't mean anything and is confusing. (From OE-Core rev: 081a391fe09a21265881e39a2a496e4e10b4f80b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Add copyright statements to files without oneRichard Purdie2022-08-121-0/+4
| | | | | | | | | Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present. (From OE-Core rev: 880c1ea3edc8edef974e65b2d424fc36809ea034) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_rpm/update-alternatives: fix package's providesChen Qi2021-08-221-3/+3
| | | | | | | | | | | | | | | | | | | | | Currently we have: $ rpm -qp --provides tmp/deploy/rpm/core2_64/bash-5.1.8-r0.core2_64.rpm bash = 5.1.8-r0 This is incorrect as bash provides /bin/bash and /bin/sh. This is caused by incomplete conversion of new override syntax, which breaks the per-file parsing of package_rpm. With this patch, we have: $ rpm -qp --provides tmp/deploy/rpm/core2_64/bash-5.1.8-r0.core2_64.rpm /bin/bash /bin/sh bash = 5.1.8-r0 (From OE-Core rev: f186d32ff8bf176ad0bd8d49e47cdb017c701a46) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Convert to new override syntaxRichard Purdie2021-08-021-15/+15
| | | | | | | | | | | | This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib/scripts: Use bb.utils.rename() instead of os.rename()Devendra Tewari2021-05-061-2/+2
| | | | | | | | | | | | | | | | | | Incremental build in Docker fails with: OSError: [Errno 18] Invalid cross-device link when source and destination are on different overlay filesystems. Rather than adding fallback code to every call site, use a new wrapper in bitbake which detects this case and falls back to shutil.move which is slower but will handtle the overlay docker filesystems correctly. [YOCTO #14301] (From OE-Core rev: 656a65b2b84e7d529b89cf5de7eb838f902d84a2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: run update-alternatives firstly in postinst scriptRobert Yang2019-06-271-2/+5
| | | | | | | | | | | | | | | | | | Recipes like postfix run command newaliases in postinst, but newaliases is installed as newaliases.postfix, it needs run update-alternatives to update it to newaliases, so there was an error when installed postinst on target. Fixed: $ opkg install postfix Configuring postfix. ///var/lib/opkg/info/postfix.postinst: line 4: newaliases: command not found Run update-alternatives firstly will fix the problem. (From OE-Core rev: 52c36dd869c605c0065c17f9ed502a319ce3dd84) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Add function to get metadataMariano Lopez2019-04-111-25/+45
| | | | | | | | | | | | | | | This adds update_alternatives_alt_targets function to get the metadata for a package. This is for code reuse because the metadata would help other classes that needs to be aware of how update-alternatives modify the final package. [YOCTO #12597] [YOCTO #13238] (From OE-Core rev: 04d966c0a91c5e16555bba827969a0a2fd96bb96) Signed-off-by: Mariano Lopez <just.another.mariano@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: correctly escape PATHs when updating FILES_${PN}André Draszik2019-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The recently added support for updating FILES based on the file renames that are happening here is using a regex replace, but failed to properly escape the search pattern (the full path). This manifests itself in FILES not being updated as soon as the full path contains any character that has a special meaning, e.g. '+'. In other words an original path (alt_target in the code) like /opt/poky/2.6+snapshot/sysroots/i686-pokysdk-linux/sbin/losetup can't be matched, and hence we fail to update FILES with the new value, causing packaging errors. Fix by using re.escape() on the original path before passing into re.sub() Fixes: 5c23fe378732 ("update-alternatives: try to update FILES_${PN} when renaming a file"), or bcb3e7b7f88a in poky.git [YOCTO #13058] (From OE-Core rev: 126743162397e4145902b3f127f2dafd80a8a49b) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: try to update FILES_${PN} when renaming a fileAndré Draszik2019-02-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using update-alternatives, FILES_${PN} must be referencing the new name after update-alternatives has renamed files. This is more or less OK when having static lists of files to be packaged into a package, but makes it quite hard to dynamically generate FILES_${PN}, e.g. using do_split_packages(), as in that case we can not easily modify what goes into FILES_${PN}, because that list is based on filenames as seen at the time do_split_packages() is executing. Of couse one could explicitly specify the (renamed) file(s) in the recipe, but that contradicts the intended usage of do_split_packages(). Instead, if FILES_${PN} contains the file name as it was pre renaming, we here modify this to reflect the new name. This will allow usage of do_split_packages() to populate FILES_${PN}. [YOCTO #13058] (From OE-Core rev: 5c23fe378732038643a450cbf916334d24764b70) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCSAndré Draszik2019-02-021-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, the update-alternatives file renaming is happening right after copying into PKGD during packaging time using an _append OVERRIDE to the copy function perform_packagecopy(). This is not really readable and hard to maintain. Additionally, this makes it impossible to e.g. populate PACKAGES dynamically using do_split_packages() and still do update-alternatives - update-alternatives file renaming requires the PACKAGES variable to have been fully populated to work correctly. On the other hand, do_split_packages() can only execute after perform_packagecopy(), as it needs PKGD populated; so it's impossible to insert do_split_packages() early enough in a deterministic way in this use-case. As there doesn't seem to be a reason not to, convert this to a proper function and use PACKAGE_PREPROCESS_FUNCS instead - after all, that's what this is meant for. No other classes or recipes in oe-core or meta-openembededd seem to have a hard requirement on update-alterantives executing before any other PACKAGE_PREPROCESS_FUNCS, so this should be perfectly fine. The only implication is that if compress_doc is inherited, compressed man-page file names will end up being, e.g. eject.1.util-linux.gz or eject.1.gz.util-linux based on the include of compress_doc.bbclass vs. update-alternatives.bbclass order, but the symlink created (alternative name) will always be correct. This solves both problems: * the code is easier to read / follow * the above described use-case can be accomodated easily [YOCTO #13058] (From OE-Core rev: 8c3db2fa735e5933f842f80321bb3ed38753812d) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar calls (again)André Draszik2019-01-141-1/+1
| | | | | | | | | | | | | | | | A couple have still been missed in the past despite multiple attempts at doing so (or simply have re-appeared?). Search & replace made using the following command: sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \ -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \ | cut -d':' -f1 \ | sort -u) (From OE-Core rev: 9f551d588693328e4d99d33be94f26684eafcaba) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Stabilize iteration orderClemens Lang2019-01-071-7/+6
| | | | | | | | | | | | | | | The use of a dictionary for link_rename causes problems for higher-order alternatives, i.e. when an alternative link points to another alternative link, since these links must be processed in the order in which they were originally added for symlink correction to work. Switch from a dict to a list of tuples to ensure processing happens in the original order. (From OE-Core rev: 326220267ffc43ec1f507ad0cc47ac59caafd5b7) Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/update-alternatives: Skip alternatives when disabledJoshua Watt2018-12-031-5/+22
| | | | | | | | | | | | | | | | | | | | | | Skips the update alternative steps for recipes that shouldn't have them enabled. Fixes errors like: nativesdk-bzip2-1.0.6-r5 do_package: bzip2: alternative target (/opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2 or /opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2.bzip2) does not exist, skipping... When building mingw SDKs [YOCTO #12962] (From OE-Core rev: d11576f569ee618a8e638eee3b1f17bf8a9d4264) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: refuse to manage SysV init scriptsMarkus Lehtonen2017-12-021-0/+4
| | | | | | | | | | | Sanity check for future packages. [YOCTO #10944] (From OE-Core rev: 061fa614cec49deb0374ccadf3013e5cc8ad2c51) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "classes: Fix alternatives and rc.d ordering"Markus Lehtonen2017-12-021-22/+7
| | | | | | | | | | | | This kludge is not needed anymore, now that syslog packages (or any other package) don't use update-alternatives for managing SysV init scripts. This reverts commit fc89a3f739ff25306ea91d9bdb424fc8389bdf72. [YOCTO #10944] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Disable for mingw32 targetsNathan Rossi2017-03-041-0/+4
| | | | | | | | | | | | | | | When building for mingw32 targets (e.g. nativesdk cross compiling for windows), disable the dependency on update-alternatives as the Windows platform does not support symlinks or package management. This avoids the complex (partly non-buildable for mingw32) dependency chain virtual/update-alternatives -> opkg-utils -> python -> ... (From OE-Core rev: 0131abe2d94d6836a54bc1616566c3bf3f2d6eb0) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Add PACKAGE_WRITE_DEPS for postinstJussi Kukkonen2017-01-201-0/+2
| | | | | | | (From OE-Core rev: 00e1e87d0dcf13f3b30682f1fb066f7fa4eed205) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Fix alternatives and rc.d orderingDavid Vincent2017-01-091-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | When using an alternative as an initscript, the ordering between update-rc.d and update-alternatives tasks during prerm and postinst tasks must always be the following in order to work: * prerm: - stop daemon - remove alternative * postinst: - add alternative - start daemon This patchset adds comments to the scripts generated by both classes and organize the generated sections based on those comments. [YOCTO #10433] Changes since v5: - Remove boolean in d.getVar() calls (From OE-Core rev: aa87b1a4dcc14e4dfe719b6c55045c5662bc59c2) Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVarFlag callsJoshua Lock2016-12-161-7/+7
| | | | | | | | | | | | | | | getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) (From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735) 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>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-26/+26
| | | | | | | | | | | | | 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>
* update-alternatives: Fix determinism issueRichard Purdie2016-05-111-2/+2
| | | | | | | | | | | | | | getVarFlags returns a dict and there is therefore no sort order. This means the order of the X_VARDEPS_X variables can change and hence the task checksums can change. This can lead to rebuilds of any parts of the system using update-alternatives and their dependees. This is a particular issue under python v3. Add in a sort to make the order of the variables deterministic. (From OE-Core rev: ecd1bfed5534f83b775a6c79092c04bd13c3af0a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: when warning about alt_link==alt_target, say what PNRoss Burton2016-01-241-1/+1
| | | | | | | | | A warning that doesn't say what the PN is doesn't really help. (From OE-Core rev: 27ad7f446ff7b6a6a4f8f0d392f03c6707340a21) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bbclass: fix spelling mistakesMaxin B. John2015-11-241-1/+1
| | | | | | | | | | Fix some spelling mistakes in bbclass files (From OE-Core rev: ed484c06f436eea62c5d0b1a2964f219f3e5cb61) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Add explict getVar param for (non) expansionRichard Purdie2015-06-231-1/+1
| | | | | | | | | | | | | | Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` (From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: alternatives should be removed in prermAndreas Oberritter2015-03-251-4/+4
| | | | | | | | | | This behaviour matches dpkg's manpage and fixes deinstalling alternatives for programs needed by the postrm script, e.g. /bin/sh. (From OE-Core rev: 2a5484a90513b58c829a916bfe5268a0fde3512a) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: We now use u-a in nativesdk so make sure the dependency ↵Richard Purdie2014-01-191-1/+1
| | | | | | | | | | | | | | is present When update-alternatives was part of opkg which got built in most nativesdk scenarios, this missing dependency wasn't an issue. We now need nativesdk-opkg-utils so we need to ensure the dependency is present in nativesdk cases. This avoids build failures with the recent u-a move to opkg-utils. (From OE-Core rev: 7e0adf676da45e49287b7ce6478a6dbfd8fa117f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: Drop deprecated code, update to show error messageRichard Purdie2013-05-221-94/+1
| | | | | | | | | This code has been deprecated for a while and confuses the class, lets drop it and just give the user hard error messages instead of the current warnings/fixups. (From OE-Core rev: 72579e1fe49e8bc66c9f5850a2c679ce8941c85d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Use modern exception raising syntaxRichard Purdie2013-05-091-2/+2
| | | | | | | | | Modern expection rasing syntax is function call format, convert to this to keep python 3 happy and model correct coding style in the core. (From OE-Core rev: f4b382754603d3f1caa13824bcc8d06b568bbc59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: Ensure DEPENDS is correct in multilib caseRichard Purdie2013-04-151-1/+1
| | | | | | | | | Ensure that the DEPENDS we're adding is correct in the multilib case by including MLPREFIX, fixing unnecessary dependencies in those images. (From OE-Core rev: 1fa8909e24866ffada75daf63225c8daa000b9be) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Drop none package specific packaging variable accessesRichard Purdie2013-02-171-2/+2
| | | | | | (From OE-Core rev: 24cbe88429ba021d7c461e0271b67106d11d5eb2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bblcass: use oe.path.realpath()Enrico Scholz2013-02-111-4/+1
| | | | | | | | | | oe.path.realpath() provides are common and more correct implementation for resolving symlinks within sysroot. Use it. (From OE-Core rev: 2fa5cc0d08e855e24a4497601d7cc73b9f2aa550) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: Add PACKAGESPLITFUNCS variableRichard Purdie2013-02-061-1/+3
| | | | | | | | | | | | | | Prepending to populate_packages is rather ugly and means its hard to trace errors and also profiling informaiton is summed together in one function. This patch starts to split out the prepends to become separate functions to avoid these issues. This is generally a neater way to write functions than prepending to where there can sometimes be variable scope issues and we've been bitten by whitespace issues in the past. (From OE-Core rev: 4f9963d1d82ee896fe9491d6a8b32be42cd06f14) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: Multithread per file dependency generation codeRichard Purdie2013-02-061-1/+1
| | | | | | (From OE-Core rev: b659eb0f2070149d9516c129b3853b41fbbd1033) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: Add a build-time dependencyMark Hatle2013-01-201-0/+13
| | | | | | | | | | | | | | | | | | | We need to add a build time dependency on virtual/update-alternatives, however we can't just do DEPENDS +=, or we end up with various problems. To work around this, in the anonymous python space we ensure we only do the addition when the package does not provide virtual/update-alternatives and it is a target package. Also the system wide PREFERRED_PROVIDER was incorrect. It references a runtime package, and not the recipe it should have. This has been corrected. [YOCTO #3691] (From OE-Core rev: 56a59ef12936dcc6464cf1d43dda6957a5aa8c65) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Tested-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: use absolute paths for link targetsChristopher Larson2013-01-071-1/+1
| | | | | | | | | | | This improves compatibility, as both the debian update-alternatives and the chkconfig alternatives require absolute paths. (From OE-Core rev: 2b8bf64f1f6999b65ddd3efc2c6ddb7e70fead53) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Add missing runtime dependencyMark Hatle2012-12-071-0/+6
| | | | | | | | | | | | | | When using update-alternatives, there should be a runtime dependency on ${VIRTUAL-RUNTIME_update-alternatives}. Without this, it's possible to get into a situation where the package is not installable. (If VIRTUAL-RUNTIME_update-alternatives is not defined, no requirement is added.) (From OE-Core rev: 8a4c5765fb56d17c3d82ff6db47863e934c9fcbe) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/classes: Various python whitespace fixesRichard Purdie2012-08-211-27/+27
| | | | | | | | | | | It was pointed out we have a number of weird indentations in the python functions. This patch cleans up 3, 7 and other weird indentations for the core bbclass files. It also fixes some wierd (odd) shell function indentation which my searches picked up. (From OE-Core rev: 8385d6d74624000d68814f4e3266d47bc8885942) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Convert tab indentation in python functions into four-spaceRichard Purdie2012-07-191-143/+143
| | | | | | (From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: Fix absolute symlink handlingRichard Purdie2012-05-301-1/+5
| | | | | | | | | | After the class changes, absolute symlinks are not being handled correctly by the class file. This adds handling for absolute symlinks to account for the pkgdest directory, removing dangling symlink messages from recipes like bzip2. (From OE-Core rev: ecea2fab2063a3c478a63e62ba0e80305674c5e0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Change from using PN to BPNMark Hatle2012-05-301-8/+8
| | | | | | | | | | In order to better support multilib processing, switch from PN to BPN. (From OE-Core rev: 75f70ab534f6dfef961906fb5c252f9e5310d38f) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: Refactor the implementationMark Hatle2012-05-301-61/+283
| | | | | | | | | | | | | | | Refactor in order to: * Deprecate the old interfaces, but keep them for compatibility * Provide a new, interface -- capable of working with split packages * Each update-alternative will now set proper "per-file" provides Note: this adds a warning message when the older deprecated behavior is used. The older behavior has been fully tested using oe-core. (From OE-Core rev: 309117d26de6a87b16406a44a0cefcbaaf7b5d7a) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives: Fix for compatibility with multilib recipesRichard Purdie2012-04-141-2/+3
| | | | | | | | | | | | The PN == BPN test was designed to exclude native/nativesdk but also unfortunately excludes multilib unintentionally. This change fixes this and allows multilib images with alternatives to funciton correctly. [YOCTO #2214] (From OE-Core rev: 2878d19c4e19d76cb8be15825c40ff03f25f35f5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie2012-03-051-7/+7
| | | | | | | | | | | | Using "1" with getVar is bad coding style and "True" is preferred. This patch is a sed over the meta directory of the form: sed \ -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \ -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \ -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/update-alternatives: fix typos and grammarPaul Eggleton2012-01-051-6/+6
| | | | | | | (From OE-Core rev: b63fd2c71b9d5d3bcaa98fe08b2e65db8c2bf6d1) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie2011-11-101-19/+19
| | | | | | | | | | | | | | | | | This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` (From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-alternatives.bbclass: don't expand var when appending do_installKevin Tian2010-11-211-2/+2
| | | | | | | | | | | | Or else absolute paths may be expanded which then breaks sstate signature comparison. I'm not sure whether pre/post funcs can be expanded or not. They are invoked at image build or on the target, and thus need be expanded some place. But if one recipe does use directories under TMP in its postinst helpers, this would be an issue again. Signed-off-by: Kevin Tian <kevin.tian@intel.com>
* update-alternative.bbclass: add batch alternatives supportKevin Tian2010-09-291-2/+81
| | | | | | | | | | | | | | | | | | | | | | | With new batch ability, we can use below simple 2 lines for multiple alternatives updates: ALTERNATIVE_LINKS = "${bindir}/cmd1 {sbindir}/cmd2 ..." ALTERNATIVE_PRIORITY = "100" Then for each command "/path/cmd" listed in ALTERNATIVE_LINKS, below is done automatically: ${D}/path/cmd is renamed to ${D}/path/cmd.{PN} a new alternative named 'cmd' is created which: links /path/cmd to /path/cmd.{PN} with priority specified in ALTERNATIVE_PRIORITY This way the recipe with multiple alternatives could be simplified a lot. There are still some cases where above assumptions may break, but I expect more recipes should benefit from this simple enhancement Fix [BUGID #257] Signed-off-by: Kevin Tian <kevin.tian@intel.com>
* classes: Remove and sanitise import statementsRichard Purdie2009-11-131-1/+0
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* classes: Standardise whitespace in anonymous python methods and factor out ↵Richard Purdie2006-11-201-4/+8
| | | | | | functions for more efficent use by bitbake (as also patched in OE) git-svn-id: https://svn.o-hand.com/repos/poky/trunk@875 311d38ba-8fff-0310-9ca6-ca027cbcb966