bitbake.git
10 years agoIgnore deprecation warnings for now
Chris Larson [Sun, 11 Apr 2010 05:07:43 +0000 (22:07 -0700)]
Ignore deprecation warnings for now

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoSwitch some references to moved functions
Chris Larson [Sun, 11 Apr 2010 05:05:02 +0000 (22:05 -0700)]
Switch some references to moved functions

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAdd a missing import of print_function
Chris Larson [Sun, 11 Apr 2010 05:04:52 +0000 (22:04 -0700)]
Add a missing import of print_function

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoApply the 2to3 print function transform
Chris Larson [Sat, 10 Apr 2010 02:46:14 +0000 (19:46 -0700)]
Apply the 2to3 print function transform

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDeprecate the usage of certain objects via certain modules
Chris Larson [Fri, 9 Apr 2010 23:51:09 +0000 (16:51 -0700)]
Deprecate the usage of certain objects via certain modules

As an example, this displays a deprecation warning for the use of
"bb.encodeurl" when you should be using "bb.fetch.encodeurl".  It includes a
convenience function for this purpose.  It should be of use when moving
objects between modules permanently, changing the API the user sees.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoException handling fixups
Chris Larson [Fri, 9 Apr 2010 21:01:11 +0000 (14:01 -0700)]
Exception handling fixups

10 years agoAdd some missing docstrings
Chris Larson [Thu, 25 Mar 2010 00:05:38 +0000 (17:05 -0700)]
Add some missing docstrings

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDrop __all__ usage
Chris Larson [Fri, 9 Apr 2010 18:51:29 +0000 (11:51 -0700)]
Drop __all__ usage

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDrop some unused functions
Chris Larson [Thu, 8 Apr 2010 22:42:53 +0000 (15:42 -0700)]
Drop some unused functions

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDrop some unused classes
Chris Larson [Thu, 8 Apr 2010 22:16:17 +0000 (15:16 -0700)]
Drop some unused classes

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDrop some unused vars
Chris Larson [Fri, 9 Apr 2010 18:47:08 +0000 (11:47 -0700)]
Drop some unused vars

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoImport fixups
Chris Larson [Thu, 8 Apr 2010 17:22:29 +0000 (10:22 -0700)]
Import fixups

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoFormatting cleanups
Chris Larson [Wed, 24 Mar 2010 23:56:12 +0000 (16:56 -0700)]
Formatting cleanups

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDon't run metadata event handlers for bb.msg events
Chris Larson [Fri, 9 Apr 2010 22:56:14 +0000 (15:56 -0700)]
Don't run metadata event handlers for bb.msg events

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoStop using functions via 'bb' that were moved from there to other modules
Chris Larson [Sat, 10 Apr 2010 00:11:03 +0000 (17:11 -0700)]
Stop using functions via 'bb' that were moved from there to other modules

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAdd a function to get the debug level, without poking into debug_levels manually
Chris Larson [Sat, 10 Apr 2010 02:34:07 +0000 (19:34 -0700)]
Add a function to get the debug level, without poking into debug_levels manually

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoFix invalid logging domain warning
Chris Larson [Sat, 10 Apr 2010 02:33:04 +0000 (19:33 -0700)]
Fix invalid logging domain warning

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoBump minimum python version check to 2.6.
Chris Larson [Sat, 10 Apr 2010 02:29:56 +0000 (19:29 -0700)]
Bump minimum python version check to 2.6.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoMake the default domain a proper domain, not a string
Chris Larson [Sat, 10 Apr 2010 02:27:21 +0000 (19:27 -0700)]
Make the default domain a proper domain, not a string

This lets you do -l Default on the commandline to bump the debug level of
messages with no domain, without bumping the level of everything else.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoImplement bb.msg.domain as a named tuple, drop the Enum class
Chris Larson [Sat, 10 Apr 2010 02:22:52 +0000 (19:22 -0700)]
Implement bb.msg.domain as a named tuple, drop the Enum class

Also fixes some bb.msg references from within bb.msg.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoFix an error in the ncurses UI
Chris Larson [Sat, 10 Apr 2010 00:55:11 +0000 (17:55 -0700)]
Fix an error in the ncurses UI

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDisplay python warnings via bb.msg
Chris Larson [Fri, 9 Apr 2010 22:55:55 +0000 (15:55 -0700)]
Display python warnings via bb.msg

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoImmediately display messages if no UI handlers are installed yet
Chris Larson [Fri, 9 Apr 2010 22:55:17 +0000 (15:55 -0700)]
Immediately display messages if no UI handlers are installed yet

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoUse __import__ for the ui rather than exec
Chris Larson [Fri, 9 Apr 2010 20:25:58 +0000 (13:25 -0700)]
Use __import__ for the ui rather than exec

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoFix the task event handling in the ncurses UI
Chris Larson [Fri, 9 Apr 2010 20:25:34 +0000 (13:25 -0700)]
Fix the task event handling in the ncurses UI

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoEnsure we always utilize the correct messaging domains
Chris Larson [Fri, 9 Apr 2010 19:33:29 +0000 (12:33 -0700)]
Ensure we always utilize the correct messaging domains

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agobb.event: NotHandled and Handled are on the way out
Chris Larson [Thu, 8 Apr 2010 23:30:52 +0000 (16:30 -0700)]
bb.event: NotHandled and Handled are on the way out

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoRename the finalise method for consistency
Chris Larson [Thu, 8 Apr 2010 23:01:14 +0000 (16:01 -0700)]
Rename the finalise method for consistency

Apparently the finalise spelling is becoming less common in British English.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoMove update_data into the DataSmart class as a finalize() method
Chris Larson [Thu, 8 Apr 2010 22:43:47 +0000 (15:43 -0700)]
Move update_data into the DataSmart class as a finalize() method

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoInitialize pkgs_to_build in the BBConfiguration constructor
Chris Larson [Thu, 8 Apr 2010 22:11:28 +0000 (15:11 -0700)]
Initialize pkgs_to_build in the BBConfiguration constructor

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoDrop doctest, as we aren't utilizing it
Chris Larson [Fri, 9 Apr 2010 18:49:36 +0000 (11:49 -0700)]
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.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAdd bin/bitbakec to .gitignore
Chris Larson [Thu, 8 Apr 2010 23:02:52 +0000 (16:02 -0700)]
Add bin/bitbakec to .gitignore

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoMade '-b' work with BBCLASSEXTEND
Enrico Scholz [Sun, 21 Mar 2010 22:02:56 +0000 (23:02 +0100)]
Made '-b' work with BBCLASSEXTEND

When BBCLASSEXTEND is set, '-b' builds usually failed with messages
like

| ERROR: Parsing error data_fn virtual:native:<recipe>.bb and fn
<recipe>.bb don't match
|
|   File ".../bb/providers.py", line 47, in sortPriorities
|     priority = dataCache.bbfile_priority[f]
| KeyError: 'virtual:native:<recipe>.bb'

This patch fixes it and allows to specify the alternative class in a
way like

| ./bitbake -b virtual:native:<recipe>.bb

This patch was written to be so minimal as possible; variables should be
probably renamed to reflect their new meaning.

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
10 years agoResurrect the old bb.vercmp as bb.utils.vercmp, and its deps
Chris Larson [Tue, 6 Apr 2010 22:29:19 +0000 (15:29 -0700)]
Resurrect the old bb.vercmp as bb.utils.vercmp, and its deps

This is just for compatibility.  We may drop it in the future, or rewrite it,
as it's not particularly pythonic.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoPass the config metadata into the Cache constructor rather than the cooker
Chris Larson [Tue, 6 Apr 2010 15:52:54 +0000 (08:52 -0700)]
Pass the config metadata into the Cache constructor rather than the cooker

Cache only uses the config metadata from the cooker, no need for the cooker itself.

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoResurrect merged anonfunc execution
Chris Larson [Wed, 31 Mar 2010 16:14:18 +0000 (09:14 -0700)]
Resurrect merged anonfunc execution

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAdd & utilize a simple_exec utility function
Chris Larson [Wed, 31 Mar 2010 15:52:41 +0000 (08:52 -0700)]
Add & utilize a simple_exec utility function

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoConsolidate the exec/eval bits, switch anonfunc to better_exec, etc
Chris Larson [Wed, 31 Mar 2010 03:06:07 +0000 (20:06 -0700)]
Consolidate the exec/eval bits, switch anonfunc to better_exec, etc

The methodpool, ${@} expansions, anonymous python functions, event handlers
now all run with the same global context, ensuring a consistent environment
for them.  Added a bb.utils.better_eval function which does an eval() with the
same globals as better_exec.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoPass an empty locals dict in expansion, since list comprehensions apparently leak...
Chris Larson [Tue, 30 Mar 2010 23:59:46 +0000 (16:59 -0700)]
Pass an empty locals dict in expansion, since list comprehensions apparently leak their '_' helper variable

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoTwo minor changes to the way python snippet expansion happens
Chris Larson [Tue, 30 Mar 2010 23:21:23 +0000 (16:21 -0700)]
Two minor changes to the way python snippet expansion happens

- Use a single dictionary for the context, both global & local, since for some
  reason it chokes wanting a global "d" rather than a local in the metadata.
- First compile the string into a code object before running eval, so we can
  include the variable name in an evaluation error.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agobitbake/event.py: Run class eventhandlers in the task context but ensure UI handlers...
Richard Purdie [Thu, 25 Mar 2010 17:33:41 +0000 (17:33 +0000)]
bitbake/event.py: Run class eventhandlers in the task context but ensure UI handlers run in the server context

(From Poky rev: d3d36d9f440288fa8bc0901ebefe875fc92409c4)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agobitbake/cooker.py: Finishing the command needs to happen after the BuildCompleted...
Richard Purdie [Thu, 25 Mar 2010 17:31:23 +0000 (17:31 +0000)]
bitbake/cooker.py: Finishing the command needs to happen after the BuildCompleted event else the cooker can shutdown first

(From Poky rev: 871f731e5733c27664c4a341cf4b6b0770cb1909)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agocache.py: Bump the cache version after the BBVERSIONS update
Richard Purdie [Thu, 25 Mar 2010 17:28:34 +0000 (17:28 +0000)]
cache.py: Bump the cache version after the BBVERSIONS update

(From Poky rev: fb245be03d8e3327165033045245f5f853c0b0d4)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agobb.manifest: Drop, its unused and obsolete. No point in having dead code around
Richard Purdie [Thu, 25 Mar 2010 15:46:18 +0000 (15:46 +0000)]
bb.manifest: Drop, its unused and obsolete. No point in having dead code around

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agoBBFILES: use a set to remove duplicates when collecting.
Chris Larson [Sun, 6 Dec 2009 19:52:52 +0000 (19:52 +0000)]
BBFILES: use a set to remove duplicates when collecting.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agobb/command was importing bb and accessing some of its own classes indirectly as bb...
Chris Larson [Thu, 25 Mar 2010 02:00:12 +0000 (19:00 -0700)]
bb/command was importing bb and accessing some of its own classes indirectly as bb.command.<class>

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoWhy is bb/__init__.py importing bb?
Chris Larson [Thu, 25 Mar 2010 01:59:24 +0000 (18:59 -0700)]
Why is bb/__init__.py importing bb?

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agodata_smart: be explicit about what we make available to eval'd python code
Chris Larson [Thu, 25 Mar 2010 01:58:59 +0000 (18:58 -0700)]
data_smart: be explicit about what we make available to eval'd python code

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoFix 7 references to undefined variables, as spotted by pyflakes
Chris Larson [Thu, 25 Mar 2010 00:48:49 +0000 (17:48 -0700)]
Fix 7 references to undefined variables, as spotted by pyflakes

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agobb.utils: remove old portage remnants
Chris Larson [Wed, 24 Mar 2010 16:21:53 +0000 (09:21 -0700)]
bb.utils: remove old portage remnants

The following utility functions were removed.  Note that in this particular
case we're bypassing a proper deprecation process, as these functions are
clearly not utilized, are obvious remnants of old ways of doing things, and
some of which do not even function properly.

- tokenize
- evaluate
- flatten
- relparse

- ververify
- isjustname
- isspecific
- catpkgsplit
- pkgsplit
- pkgcmp
- dep_parenreduce
- dep_opconvert

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agobb.utils: utilize string.letters and string.digits
Chris Larson [Wed, 24 Mar 2010 03:33:19 +0000 (20:33 -0700)]
bb.utils: utilize string.letters and string.digits

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agobb.which: fix broken direction/reverse argument
Chris Larson [Wed, 24 Mar 2010 17:31:06 +0000 (10:31 -0700)]
bb.which: fix broken direction/reverse argument

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agocrumbs: fix hassattr typo
Chris Larson [Wed, 24 Mar 2010 03:24:32 +0000 (20:24 -0700)]
crumbs: fix hassattr typo

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoImplement BBVERSIONS
Chris Larson [Sat, 20 Mar 2010 00:22:19 +0000 (17:22 -0700)]
Implement BBVERSIONS

This implements a feature similar to BBCLASSEXTEND, but for generating
multiple versions of a given recipe.  For example: BBVERSIONS = "1.0 2.0 git".

In addition to the above, one can utilize [a-b] style patterns, and can have a
:<basever> postfix, which allows you to essentially name the range of
versions.  Both the current version and the basever end up in OVERRIDES, and
the basever gets placed into the BPV variable.  The default BPV, if none is
specified, is the original PV of the recipe, before bbversions processing.

In this way, you can do things like:
BBVERSIONS = "1.0.[0-6]:1.0.0+
              1.0.[7-9]:1.0.7+"

SRC_URI_append_1.0.7+ = "file://some_extra_patch.patch;patch=1"

Or you can create a recipe per range, and name the recipe file as such: nano_1.0.7+.bb.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoutils: improve wording of error message
Bernhard Reutner-Fischer [Sat, 13 Mar 2010 11:01:38 +0000 (12:01 +0100)]
utils: improve wording of error message

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoExpand PREMIRRORS
Enrico Scholz [Sun, 21 Mar 2010 22:25:25 +0000 (23:25 +0100)]
Expand PREMIRRORS

When not expanding PREMIRRORS, the functions fails/does not work correctly
when PREMIRRORS is not a plain string (e.g. contains ${...} or a ${@...}
statements).

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agousermanual.xml: Add documentation on bblayers.conf
Richard Purdie [Mon, 22 Mar 2010 17:58:27 +0000 (17:58 +0000)]
usermanual.xml: Add documentation on bblayers.conf

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agocooker.py: Add support for a bblayers.conf file
Richard Purdie [Mon, 22 Mar 2010 17:48:31 +0000 (17:48 +0000)]
cooker.py: Add support for a bblayers.conf file

(From Poky rev: 666c753)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agocooker: bail out early if no files to build
Bernhard Reutner-Fischer [Mon, 1 Mar 2010 08:20:29 +0000 (09:20 +0100)]
cooker: bail out early if no files to build

This prevents a misleading backtrace:
ERROR: no files to build.
Command execution failed: Traceback (most recent call last):
  File ".../bitbake/build/lib/bb/command.py", line 83, in runAsyncCommand
    self.cooker.updateCache()
  File ".../bitbake/build/lib/bb/cooker.py", line 779, in updateCache
    if not self.parser.parse_next():
  File ".../bitbake/build/lib/bb/cooker.py", line 969, in parse_next
    cooker.bb_cache.sync()
UnboundLocalError: local variable 'cooker' referenced before assignment

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoFix issues with BBCLASSEXTEND set by anonymous python, and rename some variables...
Chris Larson [Mon, 1 Mar 2010 23:45:15 +0000 (18:45 -0500)]
Fix issues with BBCLASSEXTEND set by anonymous python, and rename some variables to improve code clarity

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoImplement ??= operator
Chris Larson [Thu, 25 Feb 2010 16:42:28 +0000 (09:42 -0700)]
Implement ??= operator

??= is a lazy, conditional assignment.  Whereas a ?= immediately assigns to
the variable if the variable has not yet been set, ??= does not apply the
default assignment until the end of the parse.  As a result, the final ??= for
a given variable is used, as opposed to the first as in ?=.

Note that the initial implementation relies upon finalise() to apply the
defaults, so a "bitbake -e" without specifying a recipe will not show the
defaults as set by ??=.  Moving application of the default into getVar adds
too large a performance hit.  We may want to revisit this later.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAvoid unnecessary calls to keys() when iterating over dictionaries.
Chris Larson [Thu, 11 Jun 2009 20:10:04 +0000 (13:10 -0700)]
Avoid unnecessary calls to keys() when iterating over dictionaries.

dict objects provide an __iter__ method for the iteration which gives you the
keys, so calling keys directly is unnecessary, and isn't really a best
practice.  The only time you really need to call the keys is if there's a
danger of the dict changing out from underneith you, either due to external
forces or due to modification of the iterable in the loop.  Iterations over
os.environ are apparently subject to such changes, so they must continue to
use keys().

As an aside, also switches a couple spots to using sorted() rather than
creating a temporary list with keys() and sorting that.

Signed-off-by: Chris Larson <clarson@mvista.com>
10 years agoknotty: tweak failure phrase
Bernhard Reutner-Fischer [Thu, 25 Feb 2010 13:21:21 +0000 (14:21 +0100)]
knotty: tweak failure phrase

..to make copy and paste of the logfile easier.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoFix ud.basecmd error introduced by the FETCHCMD_git commit
Chris Larson [Wed, 24 Feb 2010 16:32:26 +0000 (09:32 -0700)]
Fix ud.basecmd error introduced by the FETCHCMD_git commit

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAdd initial 'repo' fetcher
Tom Rini [Wed, 24 Feb 2010 14:19:24 +0000 (07:19 -0700)]
Add initial 'repo' fetcher

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoRe-getVar BBCLASSEXTEND after finalise()
Chris Larson [Tue, 23 Feb 2010 18:55:43 +0000 (11:55 -0700)]
Re-getVar BBCLASSEXTEND after finalise()

This ensures that an anonymous python function is able to manipulate the
BBCLASSEXTEND contents, and, therefore, amend.inc files are able to add to it.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoError early if BBPATH is unset, rather than falling back to share/bitbake
Chris Larson [Fri, 19 Feb 2010 23:26:33 +0000 (16:26 -0700)]
Error early if BBPATH is unset, rather than falling back to share/bitbake

Better to error as early as possible rather than experience strange behavior
resulting from the use of the largely useless stock bitbake.conf/base.bbclass.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoAdd PERSISTENT_DIR to bitbake.conf, as bb.fetch requires it or CACHE.
Chris Larson [Wed, 22 Jul 2009 18:19:02 +0000 (11:19 -0700)]
Add PERSISTENT_DIR to bitbake.conf, as bb.fetch requires it or CACHE.

Signed-off-by: Chris Larson <clarson@mvista.com>
10 years agoKill unused projectdir in bb package.
Chris Larson [Mon, 20 Jul 2009 04:57:09 +0000 (21:57 -0700)]
Kill unused projectdir in bb package.

Signed-off-by: Chris Larson <clarson@mvista.com>
10 years agoFix msg usage in the moved utility functions.
Chris Larson [Sun, 19 Jul 2009 17:07:00 +0000 (10:07 -0700)]
Fix msg usage in the moved utility functions.

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoMove most utility functions from bb into bb.utils.
Chris Larson [Sun, 19 Jul 2009 17:05:52 +0000 (10:05 -0700)]
Move most utility functions from bb into bb.utils.

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoMove compat imports in the bb package to avoid circular dep issues.
Chris Larson [Sun, 19 Jul 2009 16:54:46 +0000 (09:54 -0700)]
Move compat imports in the bb package to avoid circular dep issues.

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoMove encodeurl, decodeurl into bb.fetch.
Chris Larson [Sun, 19 Jul 2009 16:51:29 +0000 (09:51 -0700)]
Move encodeurl, decodeurl into bb.fetch.

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoMove MalformedUrl, VarExpandError into appropriate modules.
Chris Larson [Sun, 19 Jul 2009 16:49:36 +0000 (09:49 -0700)]
Move MalformedUrl, VarExpandError into appropriate modules.

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years agoAdd FETCHCMD parameter for git
Martyn Welch [Tue, 26 Jan 2010 14:35:51 +0000 (14:35 +0000)]
Add FETCHCMD parameter for git

The Git fetcher currently hardwires the git command to "git". Allow the
path and any additional wrappers to the Git command to be provided via
FETCHCMD functionality, as with some of the other fetchers.

If FETCHCMD_git is not define in bitbake.conf, the fetcher defaults to "git".

Signed-off-by: Malcolm Crossley <malcolm.crossley@ge.com>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
10 years agoRevert "providers.py: sort eligible providers by DEFAULT_PREFERENCE"
Richard Purdie [Tue, 16 Feb 2010 15:38:55 +0000 (15:38 +0000)]
Revert "providers.py: sort eligible providers by DEFAULT_PREFERENCE"

This breaks preferred providers functionality

This reverts commit ee9afccf33b220a21b74fab279925eeb4771249b.

10 years agofix invalid method and logic
Joshua Lock [Fri, 5 Feb 2010 12:41:08 +0000 (12:41 +0000)]
fix invalid method and logic

The previous bitbake change included an invalid method call and inverted logic.

(From Poky rev: 52cbb074235fc7b1bcd94bc1147c4607612fe701)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agoTest premirrors and mirrors in checkstatus()
Joshua Lock [Fri, 5 Feb 2010 12:08:15 +0000 (12:08 +0000)]
Test premirrors and mirrors in checkstatus()

checkstatus() is used to ensure we can fetch a copy of each file, so it makes
sense to also test PREMIRRORS and MIRRORS in the method.

This patch adds calls to try_mirrors() to the Fetch.checkstatus() method and
changes the try_mirrors() method to take a check argument, which is False by
default. When check is True try_mirrors() will call a fetchers checkstatus()
with the replaced uri.

(From Poky rev: ec92133d6fc049b4b666d670d3ac263de5a1d103)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agoFix try_mirrors() logic, was only trying the first mirror.
Joshua Lock [Thu, 4 Feb 2010 14:08:34 +0000 (14:08 +0000)]
Fix try_mirrors() logic, was only trying the first mirror.

The logic in try_mirrors() was buggy such that only the first entry in the
mirrors list was tried.

This patch fixes this. Thanks to Richard for the review.

(From Poky rev: c9fd126f64ec57cc0799ad03f32f509b5266e0ff)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agoif PREMIRRORS set test for local file in FetchData.setup_localpath
Joshua Lock [Wed, 3 Feb 2010 16:08:09 +0000 (16:08 +0000)]
if PREMIRRORS set test for local file in FetchData.setup_localpath

When we are using PREMIRRORS it's possible a mirror in the local namespace
(some filesystem path, i.e. an NFS share) provides read-only files.
This is a perfectly valid scenario so this patch fixes bitbake so that for
such a scenario locapath is set to the files path rather than some child
of DL_DIR.

(From Poky rev: afe12428a9229b9a96f9e98c86d95786689aaf79)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agoEnhance the fetchers' support for local mirrors
Joshua Lock [Tue, 2 Feb 2010 17:57:20 +0000 (17:57 +0000)]
Enhance the fetchers' support for local mirrors

Modify the try_mirrors() function to return the localpath of the fetched file
and update the data dictionary to reflect this.
Secondly the metadata files, lock and md5, should always be stored relative to
the ${DL_DIR} as it is possible that the localpath is a read-only directory,
for example in the scenario where there is a read-only file:// mirror.

(From Poky rev: b571168ac7716a8ee4bee98ba5c3b53f70a13118)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agounify mirror support and make it independant of the fetcher
Joshua Lock [Mon, 1 Feb 2010 16:56:16 +0000 (16:56 +0000)]
unify mirror support and make it independant of the fetcher

This patch serves two purposes. Firstly it unifies the concept of mirrors into
PREMIRRORS and MIRRORS. PREMIRRORS are tried before the SRC_URI defined in the
recipe whereas MIRRORS are tried only if that fails.
The tarball stash was conceptually inline with a PREMIRROR only with special
handling within the wget fetcher and therefore only worked with certain
fetch types.
Secondly the patch removes the need for individual fetch implementations to
worry about mirror handling.

With this patch, the base fetch implementation will first try to use a
PREMIRROR to fetch the desired object, if this fails the native fetch method
for the object will be tried and if this fails will try to fetch a copy from
one of the MIRRORS.

(From Poky rev: 0737552c1de18c64db8a5a52248a3e7b217f30aa)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years agoutils.py: Don't error if an exported environment variable is unset (i.e. None)
Richard Purdie [Fri, 12 Feb 2010 13:50:19 +0000 (13:50 +0000)]
utils.py: Don't error if an exported environment variable is unset (i.e. None)

(From Poky rev: 62c103ce0e154ee5bf6183987adc90fc6df154c6)

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years ago[cache] copy instead of deepcopy in sync
Holger Freyther [Sun, 17 May 2009 03:59:06 +0000 (05:59 +0200)]
[cache] copy instead of deepcopy in sync

We only intend to modify the dict, no need to copy all
elements.

10 years ago[parse] In ast, make StatementGroup inherit list, and add a AstNode base class.
Chris Larson [Tue, 21 Jul 2009 19:00:29 +0000 (12:00 -0700)]
[parse] In ast, make StatementGroup inherit list, and add a AstNode base class.

Signed-off-by: Chris Larson <clarson@mvista.com>
10 years ago[parse] Use bb.which in resolve_file
Chris Larson [Sun, 19 Jul 2009 05:36:32 +0000 (22:36 -0700)]
[parse] Use bb.which in resolve_file

Signed-off-by: Chris Larson <clarson@kergoth.com>
10 years ago[parser] Make resolve_file only resolve the path
Holger Freyther [Tue, 19 May 2009 11:59:50 +0000 (13:59 +0200)]
[parser] Make resolve_file only resolve the path

Do not attempt to open the file in the resolve_file method
(a lot like bb.which... maybe bb.which can be used). This way
we don't need to open/close a file which we have already parsed.

10 years ago[parser] Cache parsed .inc and .bbclass files for a parse speedup
Holger Freyther [Tue, 19 May 2009 11:53:12 +0000 (13:53 +0200)]
[parser] Cache parsed .inc and .bbclass files for a parse speedup

Have a growing dict with .inc and .bbclass'es. This avoids to reparse
files we have already seen.

10 years ago[parser] prepare to cache some .bbcclass and .inc files
Holger Freyther [Tue, 19 May 2009 11:22:30 +0000 (13:22 +0200)]
[parser] prepare to cache some .bbcclass and .inc files

Our parser is shit but instead to replace it now we will see
how long we can drive the wave by caching parsed files. This
will not go through the feeder again but we can just reevaluate
the StatementGroup.

10 years ago[parser] Remove the "data" from feeder, evaluate after parsing a file
Holger Freyther [Tue, 19 May 2009 10:10:37 +0000 (12:10 +0200)]
[parser] Remove the "data" from feeder, evaluate after parsing a file

Evaluate the statements after having parsed one file. This is
referred to as "entwirren" and we can remove the direct evaluation
and postpone a bit, in the future we can use a cached copy instead
of parsing the original.

10 years ago[parse] Move vars_from_file from bb.parse.BBHandler into bb.parse.
Chris Larson [Tue, 21 Jul 2009 23:22:30 +0000 (16:22 -0700)]
[parse] Move vars_from_file from bb.parse.BBHandler into bb.parse.

Signed-off-by: Chris Larson <clarson@mvista.com>
10 years ago[parse] Don't use relative import of parse_py.
Chris Larson [Wed, 22 Jul 2009 18:09:25 +0000 (11:09 -0700)]
[parse] Don't use relative import of parse_py.

Signed-off-by: Chris Larson <clarson@mvista.com>
10 years ago[parse] Move the last method to the AST...
Holger Freyther [Tue, 19 May 2009 08:57:00 +0000 (10:57 +0200)]
[parse] Move the last method to the AST...

10 years ago[parser] Move more methods to the ast scheme
Holger Freyther [Tue, 19 May 2009 08:52:18 +0000 (10:52 +0200)]
[parser] Move more methods to the ast scheme

10 years ago[parser] Move one more item to the ast
Holger Freyther [Tue, 19 May 2009 08:10:26 +0000 (10:10 +0200)]
[parser] Move one more item to the ast

10 years ago[parser] Move methodflags over to the ast
Holger Freyther [Tue, 19 May 2009 08:02:55 +0000 (10:02 +0200)]
[parser] Move methodflags over to the ast

10 years ago[parser] Build fix
Richard Purdie [Fri, 12 Feb 2010 17:45:51 +0000 (17:45 +0000)]
[parser] Build fix

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
10 years ago[parser] Move more statements over the two phase AST
Holger Freyther [Tue, 19 May 2009 07:51:29 +0000 (09:51 +0200)]
[parser] Move more statements over the two phase AST

Create the data first, then evaluate on the data dict

10 years ago[parse] Change handling include through the AstNode
Holger Freyther [Tue, 19 May 2009 07:46:42 +0000 (09:46 +0200)]
[parse] Change handling include through the AstNode

Disable the recursively evaluating the statement for now
as it is causing problems.

10 years ago[parser] Call eval and remove non ast code
Holger Freyther [Tue, 19 May 2009 07:37:41 +0000 (09:37 +0200)]
[parser] Call eval and remove non ast code