mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:19:40 +01:00
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. (From OE-Core rev: d2d352f7b747a97a54df9d20eb1455d166aa1ee3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e8db1ccef3
commit
1d4069255b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user