]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/buildhistory: use BB_CMDLINE to get bitbake command line
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 9 Jun 2017 13:50:40 +0000 (15:50 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 Jun 2017 14:04:11 +0000 (15:04 +0100)
We put the bitbake command line in the buildhistory commit message for
informational purposes, but calling sys.argv to get that as we were
previously doesn't really work in memory resident mode - that gives you
the command used to start the bitbake server which is much less
interesting. Use the just-introduced BB_CMDLINE variable instead.

Part of the fix for [YOCTO #11634].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/buildhistory.bbclass

index 3e907fc3f98b002a4f3742065ab191004b505366..74b837e974128d444cc92145c7d82fef3ceefb35 100644 (file)
@@ -696,11 +696,14 @@ def buildhistory_get_sdkvars(d):
 
 
 def buildhistory_get_cmdline(d):
-    if sys.argv[0].endswith('bin/bitbake'):
-        bincmd = 'bitbake'
-    else:
-        bincmd = sys.argv[0]
-    return '%s %s' % (bincmd, ' '.join(sys.argv[1:]))
+    argv = d.getVar('BB_CMDLINE', False)
+    if argv:
+        if argv[0].endswith('bin/bitbake'):
+            bincmd = 'bitbake'
+        else:
+            bincmd = argv[0]
+        return '%s %s' % (bincmd, ' '.join(argv[1:]))
+    return ''
 
 
 buildhistory_single_commit() {