devtool/recipetool improvements
cover devtool/recipetool improvements
The following changes since commit b18fa5f2f2f46afc6fdc58f4d29679dea9c36c43:
Remove LIC_FILES_CHKSUM from recipes without SRC_URI (2016-10-28 11:27:33 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/devtool22-oe
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool22-oe
Paul Eggleton (7):
classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
devtool: add: show recipetool create output
devtool: finish: fix error if destination layer is not in bblayers.conf
devtool: finish: warn if moving recipe to unconfigured destination layer
recipetool: create: separate LICENSE items with & by default
oe-selftest: devtool: fix error message in _test_recipe_contents()
devtool: add "rename" subcommand
meta/classes/license.bbclass | 2 + meta/lib/oeqa/selftest/devtool.py | 67 +++++++++++- scripts/lib/devtool/build.py | 2 +- scripts/lib/devtool/standard.py | 216 +++++++++++++++++++++++++++++++++++++- scripts/lib/recipetool/create.py | 37 +++++-- 5 files changed, 307 insertions(+), 17 deletions(-)
Signature · 1 line
2.5.5
PATCH 1/7 classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
If you set LIC_FILES_CHKSUM to point to a relative symlink then you'll get "Could not copy license file" warnings in copy_license_files() since the symlink won't be valid after it's copied. If the source is a symlink then we need to dereference it first.
I encountered this when I used recipetool on the sources for capnproto, where the c++ directory contains a LICENSE.txt symlink to the LICENSE file in the parent directory, and this symlink ends up being pointed to in LIC_FILES_CHKSUM.
--- meta/classes/license.bbclass | 2 ++ 1 file changed, 2 insertions(+)
meta/classes/license.bbclass +2 -0
@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir): dst = os.path.join(destdir, basename) if os.path.exists(dst): os.remove(dst) + if os.path.islink(src): + src = os.path.realpath(src) canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) if canlink: try:
Signature · 1 line
2.5.5
Re: [PATCH 1/7] classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
Quoted 9 lines · Paul Eggleton
If you set
LIC_FILES_CHKSUMto point to a relative symlink then you'll get "Could not copy license file" warnings incopy_license_files()since the symlink won't be valid after it's copied. If the source is a symlink then we need to dereference it first.I encountered this when I used recipetool on the sources for capnproto, where the c++ directory contains a LICENSE.txt symlink to the LICENSE file in the parent directory, and this symlink ends up being pointed to in
LIC_FILES_CHKSUM.
Please cherry-pick this to morty as well.
Quoted 26 lines
Signed-off-by Paul Eggleton <[email protected]>--- meta/classes/license.bbclass | 2 ++ 1 file changed, 2 insertions(+)meta/classes/license.bbclass +2
-0@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir): dst = os.path.join(destdir, basename) if os.path.exists(dst): os.remove(dst) + if os.path.islink(src): + src = os.path.realpath(src) canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) if canlink: try:Signature · 7 lines
2.5.5 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [PATCH 1/7] classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
In reply to Paul EggletonIs this sstate safe?
Quoted 38 lines · Paul Eggleton
If you set
LIC_FILES_CHKSUMto point to a relative symlink then you'll get "Could not copy license file" warnings incopy_license_files()since the symlink won't be valid after it's copied. If the source is a symlink then we need to dereference it first.I encountered this when I used recipetool on the sources for capnproto, where the c++ directory contains a LICENSE.txt symlink to the LICENSE file in the parent directory, and this symlink ends up being pointed to in
LIC_FILES_CHKSUM.Signed-off-by Paul Eggleton <[email protected]>--- meta/classes/license.bbclass | 2 ++ 1 file changed, 2 insertions(+)meta/classes/license.bbclass +2
-0@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir): dst = os.path.join(destdir, basename) if os.path.exists(dst): os.remove(dst) + if os.path.islink(src): + src = os.path.realpath(src) canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) if canlink:try:
--
2.5.5--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 1/7] classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
Hi Khem,
Why wouldn't it be?
Cheers,
Paul
Quoted 49 lines · On Mon, 31 Oct 2016 12:23:04 Khem Raj wrote:
Is this sstate safe?
On Oct 30, 2016 9:11 PM, "Paul Eggleton" <[email protected]>
Quoted 44 lines · wrote:
If you set
LIC_FILES_CHKSUMto point to a relative symlink then you'll get "Could not copy license file" warnings incopy_license_files()since the symlink won't be valid after it's copied. If the source is a symlink then we need to dereference it first.I encountered this when I used recipetool on the sources for capnproto, where the c++ directory contains a LICENSE.txt symlink to the LICENSE file in the parent directory, and this symlink ends up being pointed to in
LIC_FILES_CHKSUM.Signed-off-by Paul Eggleton <[email protected]>---
meta/classes/license.bbclass | 2 ++ 1 file changed, 2 insertions(+)meta/classes/license.bbclass +2
-0@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir): dst = os.path.join(destdir, basename) if os.path.exists(dst): os.remove(dst) + if os.path.islink(src): + src = os.path.realpath(src)canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev ==os.stat(destdir).st_dev)
if canlink:
try:
--
2.5.5--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH 1/7] classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
Quoted 6 lines · Paul Eggleton
Hi Khem,
Why wouldn't it be?
Was thinking out loud if the path is expanded to absolute paths then does it get recorded into task checksums ?
Quoted 59 lines
Cheers,
PaulQuoted 44 lines · On Mon, 31 Oct 2016 12:23:04 Khem Raj wrote:
Is this sstate safe?
On Oct 30, 2016 9:11 PM, "Paul Eggleton" <[email protected]>
Quoted 39 lines · wrote:
If you set
LIC_FILES_CHKSUMto point to a relative symlink then you'll get "Could not copy license file" warnings incopy_license_files()since the symlink won't be valid after it's copied. If the source is a symlink then we need to dereference it first.I encountered this when I used recipetool on the sources for capnproto, where the c++ directory contains a LICENSE.txt symlink to the LICENSE file in the parent directory, and this symlink ends up being pointed to in
LIC_FILES_CHKSUM.Signed-off-by Paul Eggleton <[email protected]>---
meta/classes/license.bbclass | 2 ++
1 file changed, 2 insertions(+)meta/classes/license.bbclass +2
-0@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir): dst = os.path.join(destdir, basename) if os.path.exists(dst): os.remove(dst) + if os.path.islink(src): + src = os.path.realpath(src)canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev ==os.stat(destdir).st_dev)
if canlink:
try:
--
2.5.5Quoted 5 lines
Quoted 5 lines
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core--
Paul Eggleton
Intel Open Source Technology Centre
Re: [PATCH 1/7] classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
Quoted 9 lines · Khem Raj
Quoted 1 line
On Oct 31, 2016, at 12:41 PM, Paul Eggleton <
Quoted 4 lines · [email protected]> wrote:
Hi Khem,
Why wouldn't it be?
Was thinking out loud if the path is expanded to absolute paths then does it get recorded into task checksums ?
It’s resolved in the copy_license_files function, not at parse time. Of course, any functions calling copy_license_files will change checksums due to the function itself changing, presumably.
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
PATCH 2/7 devtool: add: show recipetool create output
In reply to Paul EggletonWhen running devtool add, instead of hiding the recipetool create output, change it so that it's appropriate to show in the devtool context and show it in real-time. This means that you get status output such as when a URL is being fetched (though currently no progress information.) recipetool create now has a hidden --devtool option to enable this display mode.
--- scripts/lib/devtool/standard.py | 5 +++-- scripts/lib/recipetool/create.py | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-)
scripts/lib/devtool/standard.py +3 -2
@@ -155,7 +155,7 @@ def add(args, config, basepath, workspace): try: while True: try: - stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, tempdir, source, extracmdopts)) + stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create --devtool -o %s \'%s\' %s' % (color, tempdir, source, extracmdopts), watch=True) except bb.process.ExecutionError as e: if e.exitcode == 14: # FIXME this is a horrible hack that is unfortunately
@@ -164,11 +164,12 @@ def add(args, config, basepath, workspace): # with references to it throughout the code, so we have # to exit out and come back here to do it. ensure_npm(config, basepath, args.fixed_setup) + logger.info('Re-running recipe creation process after building nodejs') continue elif e.exitcode == 15: raise DevtoolError('Could not auto-determine recipe name, please specify it on the command line') else: - raise DevtoolError('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) + raise DevtoolError('Command \'%s\' failed' % e.command) break recipes = glob.glob(os.path.join(tempdir, '*.bb'))
scripts/lib/recipetool/create.py +19 -6
@@ -32,6 +32,18 @@ logger = logging.getLogger('recipetool') tinfoil = None plugins = None +def log_error_cond(message, debugonly): + if debugonly: + logger.debug(message) + else: + logger.error(message) + +def log_info_cond(message, debugonly): + if debugonly: + logger.debug(message) + else: + logger.info(message) + def plugin_init(pluginlist): # Take a reference to the list so we can use it later global plugins
@@ -406,7 +418,7 @@ def create_recipe(args): srctree = tempsrc if fetchuri.startswith('npm://'): # Check if npm is available - check_npm(tinfoil.config_data) + check_npm(tinfoil.config_data, args.devtool) logger.info('Fetching %s...' % srcuri) try: checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
@@ -640,7 +652,7 @@ def create_recipe(args): if not outfile: if not pn: - logger.error('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile') + log_error_cond('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile', args.devtool) # devtool looks for this specific exit code, so don't change it sys.exit(15) else:
@@ -736,7 +748,7 @@ def create_recipe(args): shutil.move(srctree, args.extract_to) if tempsrc == srctree: tempsrc = None - logger.info('Source extracted to %s' % args.extract_to) + log_info_cond('Source extracted to %s' % args.extract_to, args.devtool) if outfile == '-': sys.stdout.write('\n'.join(outlines) + '\n')
@@ -749,7 +761,7 @@ def create_recipe(args): continue f.write('%s\n' % line) lastline = line - logger.info('Recipe %s has been created; further editing may be required to make it fully functional' % outfile) + log_info_cond('Recipe %s has been created; further editing may be required to make it fully functional' % outfile, args.devtool) if tempsrc: if args.keep_temp:
@@ -1073,9 +1085,9 @@ def convert_rpm_xml(xmlfile): return values -def check_npm(d): +def check_npm(d, debugonly=False): if not os.path.exists(os.path.join(d.getVar('STAGING_BINDIR_NATIVE', True), 'npm')): - logger.error('npm required to process specified source, but npm is not available - you need to build nodejs-native first') + log_error_cond('npm required to process specified source, but npm is not available - you need to build nodejs-native first', debugonly) sys.exit(14) def register_commands(subparsers):
@@ -1093,5 +1105,6 @@ def register_commands(subparsers): parser_create.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR') parser_create.add_argument('-a', '--autorev', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true") parser_create.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)') + parser_create.add_argument('--devtool', action="store_true", help=argparse.SUPPRESS) parser_create.set_defaults(func=create_recipe)
Signature · 1 line
2.5.5
PATCH 3/7 devtool: finish: fix error if destination layer is not in bblayers.conf
In reply to Paul EggletonIf devtool finish is run on a recipe where the recipe file itself is in the workspace (e.g. where devtool add / devtool upgrade has been used) and the specified destination layer is not in bblayers.conf, then we need to avoid running bitbake -c clean at the end because the recipe has been moved, but the bbappend is still present in the workspace layer at that point and so if we do it will fail due to the dangling bbappend. It's difficult to do the clean at the point we'd want to because tinfoil is holding bitbake.lock for most of the time, but in any case cleaning the recipe is less important than it used to be since we started managing the sysroot contents more strictly, so just disable cleaning under these circumstances to avoid the problem.
Fixes [YOCTO #10484].
--- scripts/lib/devtool/standard.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/lib/devtool/standard.py +3 -1
@@ -1479,6 +1479,7 @@ def finish(args, config, basepath, workspace): check_workspace_recipe(workspace, args.recipename) + no_clean = False tinfoil = setup_tinfoil(basepath=basepath, tracking=True) try: rd = parse_recipe(config, tinfoil, args.recipename, True)
@@ -1540,6 +1541,7 @@ def finish(args, config, basepath, workspace): if origlayerdir == config.workspace_path and destpath: # Recipe file itself is in the workspace - need to move it and any # associated files to the specified layer + no_clean = True logger.info('Moving recipe file to %s' % destpath) recipedir = os.path.dirname(rd.getVar('FILE', True)) for root, _, files in os.walk(recipedir):
@@ -1554,7 +1556,7 @@ def finish(args, config, basepath, workspace): tinfoil.shutdown() # Everything else has succeeded, we can now reset - _reset([args.recipename], no_clean=False, config=config, basepath=basepath, workspace=workspace) + _reset([args.recipename], no_clean=no_clean, config=config, basepath=basepath, workspace=workspace) return 0
Signature · 1 line
2.5.5
PATCH 4/7 devtool: finish: warn if moving recipe to unconfigured destination layer
In reply to Paul EggletonIf you run devtool finish to move a recipe created in the workspace by devtool add or devtool upgrade to a layer, and that layer is not currently included in bblayers.conf (perhaps unintentionally), then the recipe will no longer be visible to bitbake. In this scenario, show a warning so that the user isn't surprised by the recipe "going missing".
--- scripts/lib/devtool/standard.py | 5 +++++ 1 file changed, 5 insertions(+)
scripts/lib/devtool/standard.py +5 -0
@@ -1517,6 +1517,11 @@ def finish(args, config, basepath, workspace): destpath = oe.recipeutils.get_bbfile_path(rd, destlayerdir, origrelpath) if not destpath: raise DevtoolError("Unable to determine destination layer path - check that %s specifies an actual layer and %s/conf/layer.conf specifies BBFILES. You may also need to specify a more complete path." % (args.destination, destlayerdir)) + # Warn if the layer isn't in bblayers.conf (the code to create a bbappend will do this in other cases) + layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()] + if not os.path.abspath(destlayerdir) in layerdirs: + bb.warn('Specified destination layer is not currently enabled in bblayers.conf, so the %s recipe will now be unavailable in your current configuration until you add the layer there' % args.recipename) + elif destlayerdir == origlayerdir: # Same layer, update the original recipe appendlayerdir = None
Signature · 1 line
2.5.5
PATCH 5/7 recipetool: create: separate LICENSE items with & by default
In reply to Paul Eggletonrecipetool sets the LICENSE value based on licenses detected from the source tree. If there are multiple licenses then they were being separated by spaces, but this isn't actually legal formatting and if you're using "devtool add" you get a warning printed when devtool parses the recipe internally.
Earlier I had made a conscious decision to do it this way since it's up to the user to figure out whether the multiple licenses should all apply (in which case they'd be separated with &) or if there is a choice of license (in which case | is the correct separator). However, I've come to the conclusion that we can just default to & and then the ugly warning goes away, and it's the safest alternative of the two (and most likely to be correct, since it's more common to have a codebase which is made up of code with different licenses, i.e. all of them apply to the combined work).
I've tweaked the comment that we add to the recipe to explicitly state that we've used & and that the user needs to change that if that's not accurate.
Fixes [YOCTO #10413].
--- meta/lib/oeqa/selftest/devtool.py | 5 ++++- scripts/lib/recipetool/create.py | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-)
meta/lib/oeqa/selftest/devtool.py +4 -1
@@ -46,7 +46,10 @@ class DevtoolBase(oeSelfTest): if needvalue is None: self.fail('Variable %s should not appear in recipe') if isinstance(needvalue, set): - value = set(value.split()) + if var == 'LICENSE': + value = set(value.split(' & ')) + else: + value = set(value.split()) self.assertEqual(value, needvalue, 'values for %s do not match' % var)
scripts/lib/recipetool/create.py +7 -5
@@ -787,10 +787,12 @@ def handle_license_vars(srctree, lines_before, handled, extravalues, d): lines_before.append('# your responsibility to verify that the values are complete and correct.') if len(licvalues) > 1: lines_before.append('#') - lines_before.append('# NOTE: multiple licenses have been detected; if that is correct you should separate') - lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there') - lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying') - lines_before.append('# documentation to determine which situation is applicable.') + lines_before.append('# NOTE: multiple licenses have been detected; they have been separated with &') + lines_before.append('# in the LICENSE value for now since it is a reasonable assumption that all') + lines_before.append('# of the licenses apply. If instead there is a choice between the multiple') + lines_before.append('# licenses then you should change the value to separate the licenses with |') + lines_before.append('# instead of &. If there is any doubt, check the accompanying documentation') + lines_before.append('# to determine which situation is applicable.') if lic_unknown: lines_before.append('#') lines_before.append('# The following license files were not able to be identified and are')
@@ -814,7 +816,7 @@ def handle_license_vars(srctree, lines_before, handled, extravalues, d): licenses = [pkg_license] else: lines_before.append('# NOTE: Original package metadata indicates license is: %s' % pkg_license) - lines_before.append('LICENSE = "%s"' % ' '.join(licenses)) + lines_before.append('LICENSE = "%s"' % ' & '.join(licenses)) lines_before.append('LIC_FILES_CHKSUM = "%s"' % ' \\\n '.join(lic_files_chksum)) lines_before.append('') handled.append(('license', licvalues))
Signature · 1 line
2.5.5
PATCH 6/7 oe-selftest: devtool: fix error message in _test_recipe_contents()
In reply to Paul EggletonIf a variable is being set in the recipe when we've explicitly passed None as the value to _test_recipe_contents() indicating that it shouldn't be set at all, then we should be printing out the variable name in the assertion message but it seems like I forgot to do a substitution. Also include the value for informational purposes.
--- meta/lib/oeqa/selftest/devtool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/selftest/devtool.py +1 -1
@@ -44,7 +44,7 @@ class DevtoolBase(oeSelfTest): if var and var in checkvars: needvalue = checkvars.pop(var) if needvalue is None: - self.fail('Variable %s should not appear in recipe') + self.fail('Variable %s should not appear in recipe, but value is being set to "%s"' % (var, value)) if isinstance(needvalue, set): if var == 'LICENSE': value = set(value.split(' & '))
Signature · 1 line
2.5.5
PATCH 7/7 devtool: add "rename" subcommand
In reply to Paul EggletonWhen you run devtool add on a source tree we attempt to figure out the correct name and version for the recipe. However, despite our best efforts, sometimes the name and/or version we come up with isn't correct, and the only way to remedy that up until now was to reset the recipe, delete the source tree and start again, specifying the name this time. To avoid this slightly painful procedure, add a "rename" subcommand that lets you rename the recipe and/or change the version.
--- meta/lib/oeqa/selftest/devtool.py | 60 +++++++++++ scripts/lib/devtool/build.py | 2 +- scripts/lib/devtool/standard.py | 202 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/devtool.py +60 -0
@@ -1349,3 +1349,63 @@ class DevtoolTests(DevtoolBase): files.remove(foundpatch) if files: self.fail('Unexpected file(s) copied next to bbappend: %s' % ', '.join(files)) + + def test_devtool_rename(self): + # Check preconditions + self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + + # First run devtool add + # We already have this recipe in OE-Core, but that doesn't matter + recipename = 'i2c-tools' + recipever = '3.1.2' + recipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, recipever)) + url = 'http://downloads.yoctoproject.org/mirror/sources/i2c-tools-%s.tar.bz2' % recipever + def add_recipe(): + result = runCmd('devtool add %s' % url) + self.assertTrue(os.path.exists(recipefile), 'Expected recipe file not created') + self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', recipename)), 'Source directory not created') + checkvars = {} + checkvars['S'] = None + checkvars['SRC_URI'] = url.replace(recipever, '${PV}') + self._test_recipe_contents(recipefile, checkvars, []) + add_recipe() + # Now rename it - change both name and version + newrecipename = 'mynewrecipe' + newrecipever = '456' + newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, newrecipever)) + result = runCmd('devtool rename %s %s -V %s' % (recipename, newrecipename, newrecipever)) + self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed') + self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipename)), 'Old recipe directory still exists') + newsrctree = os.path.join(self.workspacedir, 'sources', newrecipename) + self.assertTrue(os.path.exists(newsrctree), 'Source directory not renamed') + checkvars = {} + checkvars['S'] = '${WORKDIR}/%s-%s' % (recipename, recipever) + checkvars['SRC_URI'] = url + self._test_recipe_contents(newrecipefile, checkvars, []) + # Try again - change just name this time + result = runCmd('devtool reset -n %s' % newrecipename) + shutil.rmtree(newsrctree) + add_recipe() + newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, recipever)) + result = runCmd('devtool rename %s %s' % (recipename, newrecipename)) + self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed') + self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipename)), 'Old recipe directory still exists') + self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', newrecipename)), 'Source directory not renamed') + checkvars = {} + checkvars['S'] = '${WORKDIR}/%s-${PV}' % recipename + checkvars['SRC_URI'] = url.replace(recipever, '${PV}') + self._test_recipe_contents(newrecipefile, checkvars, []) + # Try again - change just version this time + result = runCmd('devtool reset -n %s' % newrecipename) + shutil.rmtree(newsrctree) + add_recipe() + newrecipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, newrecipever)) + result = runCmd('devtool rename %s -V %s' % (recipename, newrecipever)) + self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed') + self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', recipename)), 'Source directory no longer exists') + checkvars = {} + checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever + checkvars['SRC_URI'] = url + self._test_recipe_contents(newrecipefile, checkvars, [])
scripts/lib/devtool/build.py +1 -1
@@ -80,7 +80,7 @@ def register_commands(subparsers, context): """Register devtool subcommands from this plugin""" parser_build = subparsers.add_parser('build', help='Build a recipe', description='Builds the specified recipe using bitbake (up to and including %s)' % ', '.join(_get_build_tasks(context.config)), - group='working') + group='working', order=50) parser_build.add_argument('recipename', help='Recipe to build') parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism') parser_build.set_defaults(func=build)
scripts/lib/devtool/standard.py +202 -0
214 lines not on this page · raw message
Signature · 1 line
2.5.5