Commit Graph

24 Commits

Author SHA1 Message Date
Richard Purdie e0ffc1f378 update-alternatives: Drop deprecated code, update to show error message
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>
2013-05-22 17:16:55 +01:00
Richard Purdie db8217f6b8 classes: Use modern exception raising syntax
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>
2013-05-09 14:06:50 +01:00
Richard Purdie b45615a6ad update-alternatives: Ensure DEPENDS is correct in multilib case
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>
2013-04-15 15:57:29 +01:00
Richard Purdie 069a332d1c classes: Drop none package specific packaging variable accesses
(From OE-Core rev: 24cbe88429ba021d7c461e0271b67106d11d5eb2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17 22:32:03 +00:00
Enrico Scholz a09c5d6673 update-alternatives.bblcass: use oe.path.realpath()
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>
2013-02-11 14:46:11 +00:00
Richard Purdie 4cae28e309 package.bbclass: Add PACKAGESPLITFUNCS variable
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>
2013-02-06 13:13:00 +00:00
Richard Purdie d81aa06ece package.bbclass: Multithread per file dependency generation code
(From OE-Core rev: b659eb0f2070149d9516c129b3853b41fbbd1033)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Mark Hatle 59e15f6712 update-alternatives: Add a build-time dependency
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>
2013-01-20 13:06:43 +00:00
Christopher Larson 7f8eedaa86 update-alternatives.bbclass: use absolute paths for link targets
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>
2013-01-07 11:09:40 +00:00
Mark Hatle 1d61099065 update-alternatives.bbclass: Add missing runtime dependency
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>
2012-12-07 16:13:46 +00:00
Richard Purdie 48619958d5 meta/classes: Various python whitespace fixes
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>
2012-08-21 12:15:30 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Richard Purdie 0b8d5dad9c update-alternatives: Fix absolute symlink handling
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>
2012-05-30 17:32:31 +01:00
Mark Hatle e4449c91fb update-alternatives.bbclass: Change from using PN to BPN
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>
2012-05-30 12:04:37 +01:00
Mark Hatle 6ac7e9b598 update-alternatives.bbclass: Refactor the implementation
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>
2012-05-30 12:04:37 +01:00
Richard Purdie 6ea6facd66 update-alternatives: Fix for compatibility with multilib recipes
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>
2012-04-14 22:54:50 +01:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
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-03-05 10:22:56 -08:00
Paul Eggleton 464f8478ba classes/update-alternatives: fix typos and grammar
(From OE-Core rev: b63fd2c71b9d5d3bcaa98fe08b2e65db8c2bf6d1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-05 11:23:11 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
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>
2011-11-10 11:51:19 +00:00
Kevin Tian ad0e271a03 update-alternatives.bbclass: don't expand var when appending do_install
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-11-21 18:17:24 +00:00
Kevin Tian 22cbcd964f update-alternative.bbclass: add batch alternatives support
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>
2010-09-29 16:42:15 +01:00
Richard Purdie c54117458a classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie 8aee6b32a0 classes: Standardise whitespace in anonymous python methods and factor out 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-11-20 09:16:34 +00:00
Richard Purdie b2f192faab Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-07-21 10:10:31 +00:00