diff options
author | Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | 2017-06-28 12:49:17 -0700 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-08-21 17:28:31 +1200 |
commit | 8aa091517b16f409d7b4366fffd0fc4cdb50541a (patch) | |
tree | af4a11f06bd97e3a632a423dc49554f225e63447 /scripts/lib | |
parent | 024784eb244f5886a7f8105bfeff3a8649d263fc (diff) | |
download | openembedded-core-contrib-8aa091517b16f409d7b4366fffd0fc4cdb50541a.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.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/devtool/standard.py | 7 |
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): def addfile(fn): md5 = bb.utils.md5_file(fn) - with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f: - f.write('%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5)) + with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a+') as f: + md5_str = '%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5) + f.seek(0, os.SEEK_SET) + if not md5_str in f.read(): + f.write(md5_str) if os.path.isdir(filename): for root, _, files in os.walk(filename): |