Skip to content

Commit

Permalink
bitbake-listvars: add bitbake path to args
Browse files Browse the repository at this point in the history
as we need to properly configure this path to
import bb.tinfoil, as it could be anywhere on the system

Signed-off-by: Konrad Weihmann <[email protected]>
  • Loading branch information
priv-kweihmann committed Oct 19, 2024
1 parent 8b367e0 commit 9072ac3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/bitbake-listvars
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Based on bitbake-getvar
# Lists all defined bitbake variables

import bb.tinfoil
import argparse
import os
import sys
Expand All @@ -19,8 +18,15 @@ def main(args=None):
'-q', '--quiet', help='Silence bitbake server logging', action="store_true")
parser.add_argument(
'-p', '--path', help='List the path(s) that define the variable', action="store_true")
parser.add_argument('bitbake', help='Path to bitbake binary')
args = parser.parse_args()

bindir = os.path.dirname(args.bitbake)
topdir = os.path.dirname(bindir)
sys.path[0:0] = [os.path.join(topdir, 'lib')]

import bb.tinfoil

quiet = args.quiet
with bb.tinfoil.Tinfoil(tracking=True, setup_logging=not quiet) as tinfoil:
tinfoil.prepare(quiet=2, config_only=True)
Expand All @@ -42,11 +48,6 @@ def main(args=None):

if __name__ == "__main__":
warnings.simplefilter("default")

bindir = os.path.dirname(__file__)
topdir = os.path.dirname(bindir)
sys.path[0:0] = [os.path.join(topdir, 'lib')]

result = main()
for item in result:
if isinstance(item, tuple):
Expand Down

0 comments on commit 9072ac3

Please sign in to comment.