[bitbake-devel] [PATCH 3/4] bb/cooker: only emit ConfigFilePathFound for files which were parsed

Richard Purdie richard.purdie at linuxfoundation.org
Tue Aug 9 14:19:22 UTC 2011


On Mon, 2011-08-08 at 18:18 -0700, Joshua Lock wrote:
> When the requested configuration file is found on disk check the
> against the configuration files in __depends/__base_depends to ensure the
> file was parsed before emitting the ConfigFilePathFound event.
> If the requested file wasn't parsed just return (and don't emit).
> 
> Fixes [YOCTO #1246]
> 
> Signed-off-by: Joshua Lock <josh at linux.intel.com>
> ---
>  lib/bb/cooker.py |   32 ++++++++++++++++++++++++++++++--
>  1 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
> index 6022192..337a817 100644
> --- a/lib/bb/cooker.py
> +++ b/lib/bb/cooker.py
> @@ -609,9 +609,37 @@ class BBCooker:
>                  collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
>  
>      def findConfigFilePath(self, configfile):
> +        """
> +        Find the location on disk of configfile and if it exists and was parsed by BitBake
> +        emit the ConfigFilePathFound event with the path to the file.
> +        """
>          path = self._findConfigFile(configfile)
> -        if path:
> -            bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
> +        if not path:
> +            return
> +
> +        # Generate a list of parsed configuration files by searching the files
> +        # listed in the __depends variable with a .conf suffix.
> +        # NOTE: We can't know if we've been called before the variable has been
> +        # renamed so if depends isn't set try __base_depends (the variable name
> +        # after rename).
> +        conffiles = []
> +        dep_files = bb.data.getVar('__depends', self.configuration.data) or None
> +        if not dep_files:
> +            dep_files = bb.data.getVar('__base_depends', self.configuration.data) or set()

Nearly. You need to look at the combined array of __depends and
__base_depends values here...

Cheers,

Richard







More information about the bitbake-devel mailing list