diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-02-06 11:12:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-14 08:41:01 +0000 |
commit | 1fb1caf15ca3894e0d206ba1b7d4d9260ac93d28 (patch) | |
tree | bfb512d5cdb5338d3564e0fa6b5204fb0964400b /scripts/oe-pkgdata-util | |
parent | 9f03969994797220663280ef13fcb187446335ee (diff) | |
download | poky-1fb1caf15ca3894e0d206ba1b7d4d9260ac93d28.tar.gz |
oe-pkgdata-util: make find-path show a proper error if no package found
(From OE-Core rev: e13e53a30372a4cb3eabdb1b2199ff64c3e85cc3)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-pkgdata-util')
-rwxr-xr-x | scripts/oe-pkgdata-util | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index f70f85e147..2baa9f4c42 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util | |||
@@ -239,6 +239,7 @@ def lookup_recipe(args): | |||
239 | def find_path(args): | 239 | def find_path(args): |
240 | import json | 240 | import json |
241 | 241 | ||
242 | found = False | ||
242 | for root, dirs, files in os.walk(os.path.join(args.pkgdata_dir, 'runtime')): | 243 | for root, dirs, files in os.walk(os.path.join(args.pkgdata_dir, 'runtime')): |
243 | for fn in files: | 244 | for fn in files: |
244 | with open(os.path.join(root,fn)) as f: | 245 | with open(os.path.join(root,fn)) as f: |
@@ -248,8 +249,12 @@ def find_path(args): | |||
248 | dictval = json.loads(val) | 249 | dictval = json.loads(val) |
249 | for fullpth in dictval.keys(): | 250 | for fullpth in dictval.keys(): |
250 | if fnmatch.fnmatchcase(fullpth, args.targetpath): | 251 | if fnmatch.fnmatchcase(fullpth, args.targetpath): |
252 | found = True | ||
251 | print("%s: %s" % (fn, fullpth)) | 253 | print("%s: %s" % (fn, fullpth)) |
252 | break | 254 | break |
255 | if not found: | ||
256 | logger.error("Unable to find any package producing path %s" % args.targetpath) | ||
257 | sys.exit(1) | ||
253 | 258 | ||
254 | 259 | ||
255 | def main(): | 260 | def main(): |