summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-08-30 17:12:50 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-31 11:37:11 +0100
commit7eb7dc861f5151c91321413aa1b23d026f334b7b (patch)
tree1e1e0aebaf42a7428f57c5f1920c5de045f14f40 /scripts/lib/devtool/standard.py
parent71fdc64b8a975ca527cb7b2af6bc144f5c04ca7e (diff)
downloadpoky-7eb7dc861f5151c91321413aa1b23d026f334b7b.tar.gz
Revert "devtool: make add_md5 a public API"
This reverts commit 69c63728dae38d5b1cc9874268f235a07e04d3db. Moved add_md5 back to standard.py as it's not used in any plugin anymore. (From OE-Core rev: 3823b7abf8c1e82e0448d7283de95422fd262135) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 97c45d93b0..de7afd97c2 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -26,7 +26,7 @@ import argparse
26import scriptutils 26import scriptutils
27import errno 27import errno
28from devtool import exec_build_env_command, setup_tinfoil, DevtoolError 28from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
29from devtool import add_md5, parse_recipe 29from devtool import parse_recipe
30 30
31logger = logging.getLogger('devtool') 31logger = logging.getLogger('devtool')
32 32
@@ -105,7 +105,7 @@ def add(args, config, basepath, workspace):
105 except bb.process.ExecutionError as e: 105 except bb.process.ExecutionError as e:
106 raise DevtoolError('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) 106 raise DevtoolError('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
107 107
108 add_md5(config, args.recipename, recipefile) 108 _add_md5(config, args.recipename, recipefile)
109 109
110 initial_rev = None 110 initial_rev = None
111 if os.path.exists(os.path.join(srctree, '.git')): 111 if os.path.exists(os.path.join(srctree, '.git')):
@@ -121,7 +121,7 @@ def add(args, config, basepath, workspace):
121 if initial_rev: 121 if initial_rev:
122 f.write('\n# initial_rev: %s\n' % initial_rev) 122 f.write('\n# initial_rev: %s\n' % initial_rev)
123 123
124 add_md5(config, args.recipename, appendfile) 124 _add_md5(config, args.recipename, appendfile)
125 125
126 return 0 126 return 0
127 127
@@ -344,6 +344,13 @@ def _extract_source(srctree, keep_temp, devbranch, d):
344 shutil.rmtree(tempdir) 344 shutil.rmtree(tempdir)
345 return initial_rev 345 return initial_rev
346 346
347def _add_md5(config, recipename, filename):
348 """Record checksum of a recipe to the md5-file of the workspace"""
349 import bb.utils
350 md5 = bb.utils.md5_file(filename)
351 with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f:
352 f.write('%s|%s|%s\n' % (recipename, os.path.relpath(filename, config.workspace_path), md5))
353
347def _check_preserve(config, recipename): 354def _check_preserve(config, recipename):
348 """Check if a recipe was manually changed and needs to be saved in 'attic' 355 """Check if a recipe was manually changed and needs to be saved in 'attic'
349 directory""" 356 directory"""
@@ -471,7 +478,7 @@ def modify(args, config, basepath, workspace):
471 for commit in commits: 478 for commit in commits:
472 f.write('# commit: %s\n' % commit) 479 f.write('# commit: %s\n' % commit)
473 480
474 add_md5(config, args.recipename, appendfile) 481 _add_md5(config, args.recipename, appendfile)
475 482
476 logger.info('Recipe %s now set up to build from %s' % (args.recipename, srctree)) 483 logger.info('Recipe %s now set up to build from %s' % (args.recipename, srctree))
477 484