diff options
-rw-r--r-- | scripts/lib/devtool/__init__.py | 7 | ||||
-rw-r--r-- | scripts/lib/devtool/standard.py | 15 |
2 files changed, 11 insertions, 11 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 97ac6aeb80..404d3e6645 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -110,13 +110,6 @@ def setup_tinfoil(config_only=False): | |||
110 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) | 110 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) |
111 | return tinfoil | 111 | return tinfoil |
112 | 112 | ||
113 | def add_md5(config, recipename, filename): | ||
114 | """Record checksum of a recipe to the md5-file of the workspace""" | ||
115 | import bb.utils | ||
116 | md5 = bb.utils.md5_file(filename) | ||
117 | with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a') as f: | ||
118 | f.write('%s|%s|%s\n' % (recipename, os.path.relpath(filename, config.workspace_path), md5)) | ||
119 | |||
120 | def get_recipe_file(cooker, pn): | 113 | def get_recipe_file(cooker, pn): |
121 | """Find recipe file corresponding a package name""" | 114 | """Find recipe file corresponding a package name""" |
122 | import oe.recipeutils | 115 | import oe.recipeutils |
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 | |||
26 | import scriptutils | 26 | import scriptutils |
27 | import errno | 27 | import errno |
28 | from devtool import exec_build_env_command, setup_tinfoil, DevtoolError | 28 | from devtool import exec_build_env_command, setup_tinfoil, DevtoolError |
29 | from devtool import add_md5, parse_recipe | 29 | from devtool import parse_recipe |
30 | 30 | ||
31 | logger = logging.getLogger('devtool') | 31 | logger = 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 | ||
347 | def _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 | |||
347 | def _check_preserve(config, recipename): | 354 | def _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 | ||