summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-08-21 17:39:46 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-23 08:47:02 +0100
commitee21e81cffa8b7bd976777a46ae51cb87599fed6 (patch)
treedd07e5ad11e6b78cc03c992d58456de77f879b84 /scripts
parent42a5894a3c706f3d32555675baafca34a5046c26 (diff)
downloadpoky-ee21e81cffa8b7bd976777a46ae51cb87599fed6.tar.gz
devtool: append md5sum only if not already present
In case the proposed md5sum to be appended to the .devtool_md5 file is already present, do not append it. (From OE-Core rev: f958c5cba3b0d24ca696b2b707857009c9a7b5b8) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index ec192238ed..fa9d347693 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -674,8 +674,11 @@ def _add_md5(config, recipename, filename):
674 674
675 def addfile(fn): 675 def addfile(fn):
676 md5 = bb.utils.md5_file(fn) 676 md5 = bb.utils.md5_file(fn)
677 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f: 677 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a+') as f:
678 f.write('%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5)) 678 md5_str = '%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5)
679 f.seek(0, os.SEEK_SET)
680 if not md5_str in f.read():
681 f.write(md5_str)
679 682
680 if os.path.isdir(filename): 683 if os.path.isdir(filename):
681 for root, _, files in os.walk(filename): 684 for root, _, files in os.walk(filename):