diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-01-26 15:53:56 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-26 18:05:13 +0000 |
commit | c3f0f7be848cf4a43061350a8e3101936ed816dd (patch) | |
tree | 9aebbc87cfd4d4ac1d487d164a98c7e47345b20f /scripts/lib/devtool | |
parent | e559b66289ed802629ef0a11964748c9acf37ccf (diff) | |
download | poky-c3f0f7be848cf4a43061350a8e3101936ed816dd.tar.gz |
devtool: add: warn if modified recipe found in attic directory
If a recipe generated by "devtool add" has been modified since then when
you run "devtool reset", it will be moved into the "attic" subdirectory
of the workspace in case those modifications need to be preserved. It
seems natural that if those modifications were worth preserving we
should warn the user if such a file exists when they run "devtool add"
to create the same recipe again, so they can pick up where they left off
if they want to.
(From OE-Core rev: 0a39b907ff997c3a62c92ab22325c726b612de5b)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r-- | scripts/lib/devtool/standard.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 83ec7d8efa..187dff201f 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -190,6 +190,9 @@ def add(args, config, basepath, workspace): | |||
190 | shutil.move(recipes[0], recipefile) | 190 | shutil.move(recipes[0], recipefile) |
191 | else: | 191 | else: |
192 | raise DevtoolError('Command \'%s\' did not create any recipe file:\n%s' % (e.command, e.stdout)) | 192 | raise DevtoolError('Command \'%s\' did not create any recipe file:\n%s' % (e.command, e.stdout)) |
193 | attic_recipe = os.path.join(config.workspace_path, 'attic', os.path.basename(recipefile)) | ||
194 | if os.path.exists(attic_recipe): | ||
195 | logger.warn('A modified recipe from a previous invocation exists in %s - you may wish to move this over the top of the new recipe if you had changes in it that you want to continue with' % attic_recipe) | ||
193 | finally: | 196 | finally: |
194 | if tmpsrcdir and os.path.exists(tmpsrcdir): | 197 | if tmpsrcdir and os.path.exists(tmpsrcdir): |
195 | shutil.rmtree(tmpsrcdir) | 198 | shutil.rmtree(tmpsrcdir) |