All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Add new option --environment-more
@ 2012-02-23  8:49 Lianhao Lu
  2012-02-23  8:49 ` [PATCH 1/1] bitbake: Add new otpion --environment-more Lianhao Lu
  2012-02-23 14:57 ` [PATCH 0/1] Add new option --environment-more Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Lianhao Lu @ 2012-02-23  8:49 UTC (permalink / raw)
  To: bitbake-devel

This patch adds a new option --environment-more to bitbake to display 
additional file dependency information. This kind of information can be used 
by other recipe editors, e.g. the Eclipse bitbake commander plugin, to decide 
when to reparse the recipes.

The following changes since commit d8b3718303c3d56394c722059f1a73bd79131d0a:
  Zhai Edwin (1):
        texi2html: Fix for multilib

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib llu/bitbake_showmore
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bitbake_showmore

Lianhao Lu (1):
  bitbake: Add new otpion --environment-more

 bitbake/bin/bitbake       |    3 +++
 bitbake/lib/bb/command.py |    6 ++++--
 bitbake/lib/bb/cooker.py  |   22 ++++++++++++++++++----
 scripts/bitbake           |    2 +-
 4 files changed, 26 insertions(+), 7 deletions(-)




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] bitbake: Add new otpion --environment-more
  2012-02-23  8:49 [PATCH 0/1] Add new option --environment-more Lianhao Lu
@ 2012-02-23  8:49 ` Lianhao Lu
  2012-02-23 14:57 ` [PATCH 0/1] Add new option --environment-more Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Lianhao Lu @ 2012-02-23  8:49 UTC (permalink / raw)
  To: bitbake-devel

Added a new otpion --environment-more, similar to --environment but
displaying addtional file dependency informations in the shell variable
"__depends".

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 bitbake/bin/bitbake       |    3 +++
 bitbake/lib/bb/command.py |    6 ++++--
 bitbake/lib/bb/cooker.py  |   22 ++++++++++++++++++----
 scripts/bitbake           |    2 +-
 4 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 6da4980..efe9980 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -144,6 +144,9 @@ Default BBFILES are the .bb files in the current directory.""")
     parser.add_option("-e", "--environment", help = "show the global or per-package environment (this is what used to be bbread)",
                action = "store_true", dest = "show_environment", default = False)
 
+    parser.add_option("", "--environment-more", help = "same as --environment, but with more information",
+               action = "store_true", dest = "show_environment_more", default = False)
+
     parser.add_option("-g", "--graphviz", help = "emit the dependency trees of the specified packages in the dot syntax",
                 action = "store_true", dest = "dot_graph", default = False)
 
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 2a3a3af..d2dd99c 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -299,8 +299,9 @@ class CommandsAsync:
         (needs the cache to work out which recipe to use)
         """
         pkg = params[0]
+        more = params[1]
 
-        command.cooker.showEnvironment(None, pkg)
+        command.cooker.showEnvironment(None, pkg, more)
         command.finishAsyncCommand()
     showEnvironmentTarget.needcache = True
 
@@ -310,8 +311,9 @@ class CommandsAsync:
         or if specified the environment for a specified recipe
         """
         bfile = params[0]
+        more = params[1]
 
-        command.cooker.showEnvironment(bfile)
+        command.cooker.showEnvironment(bfile, [], more)
         command.finishAsyncCommand()
     showEnvironment.needcache = False
 
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index f0778e5..b241bc0 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -212,7 +212,7 @@ class BBCooker:
     def parseCommandLine(self):
         # Parse any commandline into actions
         self.commandlineAction = {'action':None, 'msg':None}
-        if self.configuration.show_environment:
+        if self.configuration.show_environment or self.configuration.show_environment_more:
             if 'world' in self.configuration.pkgs_to_build:
                 self.commandlineAction['msg'] = "'world' is not a valid target for --environment."
             elif 'universe' in self.configuration.pkgs_to_build:
@@ -222,9 +222,9 @@ class BBCooker:
             elif self.configuration.buildfile and len(self.configuration.pkgs_to_build) > 0:
                 self.commandlineAction['msg'] = "No target should be used with the --environment and --buildfile options."
             elif len(self.configuration.pkgs_to_build) > 0:
-                self.commandlineAction['action'] = ["showEnvironmentTarget", self.configuration.pkgs_to_build]
+                self.commandlineAction['action'] = ["showEnvironmentTarget", self.configuration.pkgs_to_build, self.configuration.show_environment_more]
             else:
-                self.commandlineAction['action'] = ["showEnvironment", self.configuration.buildfile]
+                self.commandlineAction['action'] = ["showEnvironment", self.configuration.buildfile, self.configuration.show_environment_more]
         elif self.configuration.buildfile is not None:
             self.commandlineAction['action'] = ["buildFile", self.configuration.buildfile, self.configuration.cmd]
         elif self.configuration.revisions_changed:
@@ -277,7 +277,7 @@ class BBCooker:
 
             logger.plain("%-35s %25s %25s", p, lateststr, prefstr)
 
-    def showEnvironment(self, buildfile = None, pkgs_to_build = []):
+    def showEnvironment(self, buildfile = None, pkgs_to_build = [], more = False):
         """
         Show the outer or per-package environment
         """
@@ -330,6 +330,20 @@ class BBCooker:
             if data.getVarFlag( e, 'python', envdata ):
                 logger.plain("\npython %s () {\n%s}\n", e, data.getVar(e, envdata, 1))
 
+        # more depends data
+        if more:
+            if fn:
+                realfn, _ = bb.cache.Cache.virtualfn2realfn(fn)
+                logger.plain("\n__file=\"%s\"", realfn)
+            dep_files = []
+            depends = envdata.getVar('__depends', True) or set()
+            depends = depends.union(self.configuration.data.getVar('__base_depends', True) or set())
+            depends = depends.union(self.configuration.data.getVar('__depends', True) or set())
+            for (fn, ctime) in depends:
+                dep_files.append(os.path.abspath(fn))
+            if dep_files:
+                logger.plain("__depends=\"%s\"\n" , " ".join(dep_files))
+
     def prepareTreeData(self, pkgs_to_build, task):
         """
         Prepare a runqueue and taskdata object for iteration over pkgs_to_build
diff --git a/scripts/bitbake b/scripts/bitbake
index dda3b26..d77ecb5 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -3,7 +3,7 @@
 export BBFETCH2=True
 export BB_ENV_EXTRAWHITE="PSEUDO_BUILD PSEUDO_DISABLED $BB_ENV_EXTRAWHITE"
 
-NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --environment -g --graphviz"
+NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --environment --environment-more -g --graphviz"
 PASSTHROUGH_OPTS="-D -DD -DDD -DDDD -v"
 needpseudo="1"
 for opt in $@; do
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] Add new option --environment-more
  2012-02-23  8:49 [PATCH 0/1] Add new option --environment-more Lianhao Lu
  2012-02-23  8:49 ` [PATCH 1/1] bitbake: Add new otpion --environment-more Lianhao Lu
@ 2012-02-23 14:57 ` Richard Purdie
  2012-02-24  3:06   ` Lu, Lianhao
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2012-02-23 14:57 UTC (permalink / raw)
  To: Lianhao Lu; +Cc: bitbake-devel

On Thu, 2012-02-23 at 16:49 +0800, Lianhao Lu wrote:
> This patch adds a new option --environment-more to bitbake to display 
> additional file dependency information. This kind of information can be used 
> by other recipe editors, e.g. the Eclipse bitbake commander plugin, to decide 
> when to reparse the recipes.
> 
> The following changes since commit d8b3718303c3d56394c722059f1a73bd79131d0a:
>   Zhai Edwin (1):
>         texi2html: Fix for multilib
> 
> are available in the git repository at:
> 
>   git://git.pokylinux.org/poky-contrib llu/bitbake_showmore
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bitbake_showmore
> 
> Lianhao Lu (1):
>   bitbake: Add new otpion --environment-more

Rather than add a new option specifically for this, I'm tempted just to
add the variables to the -e output...

The trouble is that variables starting "__" are considered internal use
by bitbake. Would it work if we merge __base_depends and __depends and
print this as some specific variable like BBINCLUDES ? I can imagine
that being useful elsewhere too and we don't expose the internal split
of the variable that way...

Cheers,

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] Add new option --environment-more
  2012-02-23 14:57 ` [PATCH 0/1] Add new option --environment-more Richard Purdie
@ 2012-02-24  3:06   ` Lu, Lianhao
  0 siblings, 0 replies; 4+ messages in thread
From: Lu, Lianhao @ 2012-02-24  3:06 UTC (permalink / raw)
  To: bitbake-devel

Richard Purdie wrote on 2012-02-23:
> On Thu, 2012-02-23 at 16:49 +0800, Lianhao Lu wrote:
>> This patch adds a new option --environment-more to bitbake to display
>> additional file dependency information. This kind of information can be used
>> by other recipe editors, e.g. the Eclipse bitbake commander plugin, to decide
>> when to reparse the recipes.
>> 
>> The following changes since commit d8b3718303c3d56394c722059f1a73bd79131d0a:
>>   Zhai Edwin (1):
>>         texi2html: Fix for multilib
>> are available in the git repository at:
>> 
>>   git://git.pokylinux.org/poky-contrib llu/bitbake_showmore
>>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/bitbake_showmore
>> Lianhao Lu (1):
>>   bitbake: Add new otpion --environment-more
> 
> Rather than add a new option specifically for this, I'm tempted just to
> add the variables to the -e output...
> 
> The trouble is that variables starting "__" are considered internal use
> by bitbake. Would it work if we merge __base_depends and __depends and
> print this as some specific variable like BBINCLUDES ? I can imagine
> that being useful elsewhere too and we don't expose the internal split
> of the variable that way...
> 

I added a new variable BBINCLUDES in the oe-core meta layer. Please ignore this one 
and see the patch in oe-core mailing list instead. 

Best Regards,
Lianhao



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-24  3:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-23  8:49 [PATCH 0/1] Add new option --environment-more Lianhao Lu
2012-02-23  8:49 ` [PATCH 1/1] bitbake: Add new otpion --environment-more Lianhao Lu
2012-02-23 14:57 ` [PATCH 0/1] Add new option --environment-more Richard Purdie
2012-02-24  3:06   ` Lu, Lianhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.