diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-04-27 10:53:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-27 15:05:40 +0100 |
commit | d2d352f7b747a97a54df9d20eb1455d166aa1ee3 (patch) | |
tree | 587b1f93d0326a384d6a063cfd6357a3c53b62fe | |
parent | bdbeff0cd342e31053d7203d78fc5dda611052b1 (diff) | |
download | openembedded-core-d2d352f7b747a97a54df9d20eb1455d166aa1ee3.tar.gz openembedded-core-d2d352f7b747a97a54df9d20eb1455d166aa1ee3.tar.bz2 openembedded-core-d2d352f7b747a97a54df9d20eb1455d166aa1ee3.zip |
devtool: reset: avoid errors in case file no longer exists
If you manually delete files in the workspace layer (which you really
shouldn't) it was possible to get yourself into the situation where you
couldn't reset because we were attempting to check if the file had been
modified and erroring out if it couldn't be opened. If the file's not
there anymore there's not much point checking if it needs to be
preserved, just skip it.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/lib/devtool/standard.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 893226578a..d561e40115 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -308,7 +308,14 @@ def _check_preserve(config, recipename): splitline = line.rstrip().split('|') if splitline[0] == recipename: removefile = os.path.join(config.workspace_path, splitline[1]) - md5 = bb.utils.md5_file(removefile) + try: + md5 = bb.utils.md5_file(removefile) + except IOError as err: + if err.errno == 2: + # File no longer exists, skip it + continue + else: + raise if splitline[2] != md5: bb.utils.mkdirhier(preservepath) preservefile = os.path.basename(removefile) |