aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/update-alternatives.bbclass
AgeCommit message (Collapse)Author
2017-02-08classes: Fix alternatives and rc.d orderingDavid Vincent
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] Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit aa87b1a4dcc14e4dfe719b6c55045c5662bc59c2)
2016-05-11update-alternatives: Fix determinism issueRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22update-alternatives: when warning about alt_link==alt_target, say what PNRoss Burton
A warning that doesn't say what the PN is doesn't really help. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24bbclass: fix spelling mistakesMaxin B. John
Fix some spelling mistakes in bbclass files Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
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 *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-24update-alternatives.bbclass: alternatives should be removed in prermAndreas Oberritter
This behaviour matches dpkg's manpage and fixes deinstalling alternatives for programs needed by the postrm script, e.g. /bin/sh. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-17update-alternatives: We now use u-a in nativesdk so make sure the dependency ↵Richard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-21update-alternatives: Drop deprecated code, update to show error messageRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes: Use modern exception raising syntaxRichard Purdie
Modern expection rasing syntax is function call format, convert to this to keep python 3 happy and model correct coding style in the core. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-15update-alternatives: Ensure DEPENDS is correct in multilib caseRichard Purdie
Ensure that the DEPENDS we're adding is correct in the multilib case by including MLPREFIX, fixing unnecessary dependencies in those images. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17classes: Drop none package specific packaging variable accessesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11update-alternatives.bblcass: use oe.path.realpath()Enrico Scholz
oe.path.realpath() provides are common and more correct implementation for resolving symlinks within sysroot. Use it. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Add PACKAGESPLITFUNCS variableRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Multithread per file dependency generation codeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-20update-alternatives: Add a build-time dependencyMark Hatle
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] 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>
2013-01-04update-alternatives.bbclass: use absolute paths for link targetsChristopher Larson
This improves compatibility, as both the debian update-alternatives and the chkconfig alternatives require absolute paths. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-07update-alternatives.bbclass: Add missing runtime dependencyMark Hatle
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.) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21meta/classes: Various python whitespace fixesRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30update-alternatives: Fix absolute symlink handlingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30update-alternatives.bbclass: Change from using PN to BPNMark Hatle
In order to better support multilib processing, switch from PN to BPN. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2012-05-30update-alternatives.bbclass: Refactor the implementationMark Hatle
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. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2012-04-14update-alternatives: Fix for compatibility with multilib recipesRichard Purdie
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie
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>
2012-01-05classes/update-alternatives: fix typos and grammarPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
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 *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-11-21update-alternatives.bbclass: don't expand var when appending do_installKevin Tian
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>
2010-09-29update-alternative.bbclass: add batch alternatives supportKevin Tian
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>
2009-11-13classes: Remove and sanitise import statementsRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2006-11-20classes: Standardise whitespace in anonymous python methods and factor out ↵Richard Purdie
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
2006-07-21Rename /openembedded/ -> /meta/Richard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966