find_packages.py: Do not write anything if recipe is not found.
@@ -159,7 +159,7 @@ def main():
parser.add_argument('recipe', metavar='recipe', help='a recipe to investigate')
args = parser.parse_args()
rn = args.recipe
- with open(rn + '-dependencies.yml', "w") as manifest_file, bb.tinfoil.Tinfoil() as tinfoil:
+ with bb.tinfoil.Tinfoil() as tinfoil:
tinfoil.prepare()
# These are the packages that bitbake assumes are provided by the host
# system. They do not have recipes, so searching tinfoil for them will
@@ -169,8 +169,13 @@ def main():
if SKIP_BUILD_TOOLS:
assume_provided.extend(KNOWN_BUILD_TOOLS)
- manifest_file.write('project:\n')
data = get_recipe_info(tinfoil, rn)
+ if not data:
+ print('Nothing to do!')
+ return
+
+ with open(rn + '-dependencies.yml', "w") as manifest_file:
+ manifest_file.write('project:\n')
data.depends = []
depends = data.getVar('DEPENDS').split()
for dep in depends:
