Commit Graph

50 Commits

Author SHA1 Message Date
Christopher Larson 1670051a79 codeparser: silence non-literal warnings for vardeps
If the vardeps flag is not None, we now silence the warnings about
non-literal usage for that variable.

(Bitbake rev: e724b9f417d1baf898f5afc6376c73c1a2ad8db9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:13 +00:00
Christopher Larson 2b26745c70 codeparser: accept a name for better messages
- If a name is passed to the parser, prepend the messages with "while
  parsing <name>:". This gives a bit more context.
- Tweak the warning messages slightly (they had to be altered anyway to
  inject the variable being parsed).

Before:
  DEBUG: Warning: in call to 'bb.data.getVar': argument ''%s' % var' is \
         not a literal

After:
  DEBUG: while parsing emit_pkgdata, in call of bb.data.getVar, argument \
         ''%s' % var' is not a string literal

(Bitbake rev: 1060193ae4d54e667735dbff5d1d2be49a3f95c9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 9a68fb1364 data/siggen: Add vardepvalue mechanism to allow the variable dependency code to be forced to specific values
We have a problem if we want to inject specific information into the variable
dependency code. There are cases for example where we want a dependency
on the value of X but it doesn't matter how X was constructed or what
dependencies it might have had, we only care about the absolute value.
With the current code, its near enough impossible to do this.

This patch adds such a mechanism so the user can trigger this with code like:

baselib[vardepvalue] = "${baselib}"

It also refactors some of the code so we do variable lookups once
instead of doing this in two different functions.

[YOCTO #1583]

(Bitbake rev: 6c879b44ccf42dc73fe4467076e114700d7ba81b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Joshua Lock 61d83c6d6b Ensure only the filtered environment variables are inherited from the OS
The recent change which modified inheritFromOS to use the intial
environment, rather than the current environment, introduced a bug such
that variables which had been cleaned from the environment where still set
in the data store.

This patch changes things such that a list of approved environment
variables is saved after the environment is cleaned and only the variables
in this list are inherited in inheritFromOS.

CC: James Limbouris <james.limbouris@gmail.com>
CC: Chris Larson <clarson@kergoth.com>
(Bitbake rev: cb6c07054e8baf94614713ec257c643b22266d75)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15 09:49:37 +01:00
Joshua Lock 50016106ad data|cooker: use saved environment variables when calling inheritFromOS
Now that we have a pristine copy of the variables available at launch time
we can use them when looking to inherit the OS's environment.

(Bitbake rev: 21c21fcc5871e81d8d497b6baed605cdd74c4571)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26 13:46:27 +01:00
Scott Garman 62d538fbe6 make exception handling syntax consistent
Update exception handling syntax to use the modern style:
except ExcType as localvar

(Bitbake rev: dbf5f42b06bef81749b13aa99945cc1292a6676d)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-15 11:13:13 +01:00
Richard Purdie c7f76a1bc9 bitbake/data/runqueue: Sync up with upstream to clean up environment variable handling
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:28 +01:00
Richard Purdie 25b3d39612 bitbake/siggen.py: Fix whitelisted variable handling
Even when a variable was whitelisted, any dependencies of that variable
could still creep into the task hash due to the way the whitelisting
code worked. This patch changes thing to ensure that when whitelisted,
that whitelisting applies to the variable and any dependencies it has.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 15:58:48 +00:00
Richard Purdie c186419173 bitbake: Sync environment handling function names and comments with upstream alterations
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:03 +00:00
Lianhao Lu 6f454c10bc bitbake/data.py: corrected the output for shell syntax.
[BUGID# 645], modify the emit_var()
1. Added "#" to the beginning of each line if the comment contains
multiple lines.

2. Added "\" to the end of each line if the shell variable value
contains multiple lines.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
2011-01-07 11:14:22 +00:00
Bernhard Reutner-Fischer 83f0b79f43 data: fewer newlines for (un)export
Previously we emitted two newlines for export and unexport.
One newline for export and unexport is enough (and makes the scripts
look better and a tad smaller).

(Bitbake rev: ba060160fdf1278a273fb2b77d36b8c681807ecf)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 15:00:11 +00:00
Richard Purdie 0090a798eb bitbake: Sync a load of whitespace and other non-functionality changes with bitbake uptream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:54 +00:00
Paul Eggleton 80e6408b9f bitbake: add optional expansion to getVarFlag()
Add a parameter to getVarFlag() to auto-expand the value of the flag. This
makes getVarFlag() more consistent with getVar(), and allows expansion of
vardeps and vardepsexclude (which has been done in this commit).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-14 22:36:19 +00:00
Paul Eggleton a52e4063f4 bitbake: allow excluding dependencies of variables
Adds a vardepsexclude flag that can be used to exclude a dependency of
a variable (the opposite of vardeps). This will allow the exclusion of
variables from the hash generation much more selectively than blanket
whitelisting using BB_HASHBASE_WHITELIST.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-14 22:35:50 +00:00
Richard Purdie 0ba9a9fffe bitbake: Overhaul environment handling
Currently, anything whitelisted in the environment makes it into the worker
processes. This is undesireable and the worker environment should be as
clean as possible. This patch adapts bitbake sosme variables are loaded into
bitbake's datastore but not exported by default. Any variable can be exported
by setting its export flag.

Currently, this code only finalises the environment in he worker as doing so
in the server means variables are unavailable in the worker. If we switch
back to fork() calls instead of exec() this code will need revisting.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-09 13:16:14 +00:00
Richard Purdie 4aec2155a5 bitbake/data.py: Allow variables to suplement dependencies using the vardep flag
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-13 12:16:46 +01:00
Richard Purdie 332c33af18 bitbake/data.py: Add emit_func() and generate_dependencies() functions
These functions allow generation of dependency data between funcitons and
variables allowing moves to be made towards generating checksums and allowing
use of the dependency information in other parts of bitbake.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-31 12:47:41 +01:00
Richard Purdie 604f12722a bitbake/data.py: Handle exceptions in export_bars in the same way as emit_var()
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-20 09:42:31 +01:00
Richard Purdie b6bfe14205 bitbake: Switch to use subprocess for forking tasks and FAKEROOTENV to run shell and python under a fakeroot environment
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 22:36:25 +01:00
Chris Larson d217bedd32 Don't emit vars starting with __, as those are internal
(Bitbake rev: 211f44ce0e15c7c419606e9ef3568d9cea6775b7)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson 8bc7ebb4ae Enhance the expansion exception message
(Bitbake rev: 1cc11164a85a5b30d6b9184cb5a8f7f7ac1aaff2)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson 15248f3e7d Allow emission of non-string objects in emit_var, instead running str() on it first
(Bitbake rev: 5b09e28cb4a2c6c99ad58e71fb803160922a7e1e)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson 9d3f301423 emit_env: clean up, iterate once
(Bitbake rev: db718ec6f67c7c0d0efb4ba0b5b24384f707dcf5)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson 22a2179905 Kill unnecessary usages of the types module
types.IntType -> int
types.StringType -> basestring
...

Also moves our ImmutableTypes tuple into our own namespace.

(Bitbake rev: 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 1180bab54e Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson d5927a70bb Drop unused bb.data.expandData function
(Bitbake rev: 188af3ef5fdb5cd86b74147bf5eafc085ac489be)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson cf58d41af8 Add some missing docstrings
(Bitbake rev: 20b6f2d1d2d4541e612e8cffbdf1ca4822a3e394)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 266f416446 Drop some unused functions
(Bitbake rev: eb83df5bc7077685f314df01949cf06850e4693c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson bbc565e825 Drop some unused classes
(Bitbake rev: 5cc47a49518c69c94f8b78e9dda6d542ba17b1e8)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 7acc132cac Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson bbf83fd988 Drop doctest, as we aren't utilizing it
We should add back in some proper unit testing.  Doctest is rather limited,
and we haven't actually made use of it since the original implementation of
the datastore when the project started, as far as I'm aware.

(Bitbake rev: 3a11c2807972bbbddffde2fa67fc380d159da467)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson c9c230b14a Move update_data into the DataSmart class as a finalize() method
(Bitbake rev: ff801397785567cb84b3615de86bff764d65decf)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:31 +01:00
Chris Larson a3012e1ca9 Move MalformedUrl, VarExpandError into appropriate modules.
(Bitbake rev: e616483b237dafff7f90ba1c09e9ee7c383a2e47)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:53:55 +00:00
Richard Purdie 22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie 107a9da006 bitbake: Merge further fixes from upstream 1.8 branch
* Make the test functionality work
* Optimise BBPATH handling when changing directory
* Optimise file globing for BBFILES

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-11 22:41:17 +01:00
Richard Purdie 44a88198c1 bitbake: Make sure existing environment variables are properly exported
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-09 15:28:17 +01:00
Robert Bradford 696d4f01d2 bitbake: Refactor the environment variable handling
Refactor the environment variable handling so that it more closes matches the
changes that have been made in bitbake-dev.

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5527 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-10-17 09:46:35 +00:00
Richard Purdie 2e182847e4 bitbake/bitbake-dev: Allow much better control of which variable influence bitbake from the environment
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5347 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-09-30 20:57:18 +00:00
Richard Purdie 498b4f45da bitbake data.py: Fix unexport handling (#OE3135)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2948 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-10-22 11:53:17 +00:00
Richard Purdie d8bfa5c6ef bitbake: Sync with 1.8.8 release
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2513 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-20 07:48:43 +00:00
Richard Purdie 7611768e23 bitbake: Sync with 1.8 head. Adds locking to the fetcher to prevent parallel downloads, fixes key expansion issues and occasional missing dependency graph links
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2502 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-16 09:55:21 +00:00
Richard Purdie ce800d3aea bitbake: Sync with upstream 1.8 branch for fixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2484 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-12 23:06:49 +00:00
Richard Purdie bfc70eb24e bitbake: Update along 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2345 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-03 13:40:52 +00:00
Richard Purdie f5665d5bfc bitbake: Sync with upstream.
* File licence headers were sanitised causing most of the diff. 
 * cooker.py was created from bin/bitbake. 
 * cvs fetcher port option was added
 * The -f force option was fixed to work correctly
 * Multiple entries in rrecrdeps are now handled correctly
   (allows adding do_deploy to image depends)
 


git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1129 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08 23:53:01 +00:00
Richard Purdie 681d6c18ad bitbake: Sync with bitbake trunk for bugfixes and improved dot file generation code
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@987 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-29 22:52:37 +00:00
Richard Purdie 0da3c82a66 bitbake/lib/bb/data.py: Add unexport flag for variables, add speedup for expandKeys
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@956 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-25 09:57:29 +00:00
Richard Purdie 306b7c7a97 bitbake: Upgrade from 1.4 -> 1.7.4ish
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@863 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-16 15:02:15 +00:00
Richard Purdie 27dba1e624 Update to bitbake 1.4.2 (latest stable branch release). This includes the caching speedups
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@371 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-05-09 15:44:08 +00:00
Richard Purdie b26a945734 Update to latest bitbake
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@309 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-03-20 17:45:11 +00:00
Richard Purdie f54da734eb Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@2 311d38ba-8fff-0310-9ca6-ca027cbcb966
2005-08-31 10:47:56 +00:00