diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-02 23:51:02 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-25 15:01:21 +0100 |
commit | 59fe0384335ec615fa190affd758eb8c4446bfdc (patch) | |
tree | f70dd023c4ab0376749b491ee08abd59b837761b /scripts | |
parent | 597d0da6b4d64767f2bf6f40c49f4c4bd701f193 (diff) | |
download | poky-59fe0384335ec615fa190affd758eb8c4446bfdc.tar.gz |
resulttool: Allow store to work on single files
Store operations using a single file as a source weren't working as the os.walk
command didn't like being given a single file. Fix the store operation to
work for single files.
(From OE-Core rev: 639598aa855df523e3dd1f8df1b0eacfa7fb13d6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/resulttool/store.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/lib/resulttool/store.py b/scripts/lib/resulttool/store.py index 5e33716c3d..3a81933242 100644 --- a/scripts/lib/resulttool/store.py +++ b/scripts/lib/resulttool/store.py | |||
@@ -29,15 +29,18 @@ def store(args, logger): | |||
29 | try: | 29 | try: |
30 | results = {} | 30 | results = {} |
31 | logger.info('Reading files from %s' % args.source) | 31 | logger.info('Reading files from %s' % args.source) |
32 | for root, dirs, files in os.walk(args.source): | 32 | if os.path.isfile(args.source): |
33 | for name in files: | 33 | resultutils.append_resultsdata(results, args.source) |
34 | f = os.path.join(root, name) | 34 | else: |
35 | if name == "testresults.json": | 35 | for root, dirs, files in os.walk(args.source): |
36 | resultutils.append_resultsdata(results, f) | 36 | for name in files: |
37 | elif args.all: | 37 | f = os.path.join(root, name) |
38 | dst = f.replace(args.source, tempdir + "/") | 38 | if name == "testresults.json": |
39 | os.makedirs(os.path.dirname(dst), exist_ok=True) | 39 | resultutils.append_resultsdata(results, f) |
40 | shutil.copyfile(f, dst) | 40 | elif args.all: |
41 | dst = f.replace(args.source, tempdir + "/") | ||
42 | os.makedirs(os.path.dirname(dst), exist_ok=True) | ||
43 | shutil.copyfile(f, dst) | ||
41 | 44 | ||
42 | revisions = {} | 45 | revisions = {} |
43 | 46 | ||