Skip to content

Commit 93b7177

Browse files
authored
Merge pull request #648 from jkloetzke/extend-query-recipe
Extend query recipe
2 parents 5c7e356 + a248011 commit 93b7177

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

doc/manpages/bob-query-recipe.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ Synopsis
1717

1818
bob query-recipe [-h] [-D DEFINES] [-c CONFIGFILE]
1919
[--sandbox | --slim-sandbox | --dev-sandbox | --strict-sandbox | --no-sandbox]
20-
package
20+
packages [packages ...]
2121

2222
Description
2323
-----------
2424

25-
Query recipe and class files of package.
25+
Print the involved recipe and class files of packages. Each file name is
26+
printed only once, even if multiple packages are specied that share source
27+
files.
2628

2729
Options
2830
-------

pym/bob/cmds/misc.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def showPackage(package, recurse, done, donePackages):
268268
def doQueryRecipe(argv, bobRoot):
269269
parser = argparse.ArgumentParser(prog="bob query-recipe",
270270
description="Query recipe and class files of package.")
271-
parser.add_argument('package', help="(Sub-)package to query")
271+
parser.add_argument('packages', nargs='+', help="(Sub-)packages to query")
272272
parser.add_argument('-D', default=[], action='append', dest="defines",
273273
help="Override default environment variable")
274274
parser.add_argument('-c', dest="configFile", default=[], action='append',
@@ -292,9 +292,14 @@ def doQueryRecipe(argv, bobRoot):
292292
recipes = RecipeSet()
293293
recipes.setConfigFiles(args.configFile)
294294
recipes.parse(defines)
295-
package = recipes.generatePackages(lambda s,m: "unused", args.sandbox).walkPackagePath(args.package)
295+
packages = recipes.generatePackages(lambda s,m: "unused", args.sandbox)
296+
297+
result = set()
298+
for p in args.packages:
299+
for package in packages.queryPackagePath(p):
300+
result.update(package.getRecipe().getSources())
296301

297-
for fn in package.getRecipe().getSources():
302+
for fn in sorted(result):
298303
print(fn)
299304

300305
def doInit(argv, bobRoot):

0 commit comments

Comments
 (0)