devtool: sdk-update: drop support for local updates

Having two code paths here makes maintenance difficult, and it doesn't
seem likely that you would use the local case in real usage anyway, so
drop the local support entirely.

This should allow us to resolve [YOCTO #9301].

(From OE-Core rev: 7a4c9c96fee4fb514c2b69b52e811c4f896a16f1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2016-05-20 22:21:18 +12:00 committed by Richard Purdie
parent 0111181bbb
commit 02986886fc
2 changed files with 76 additions and 115 deletions

View File

@ -30,9 +30,6 @@ class SdkUpdateTest(oeSDKExtTest):
def test_sdk_update_http(self):
output = self._run("devtool sdk-update \"%s\"" % self.http_url)
def test_sdk_update_local(self):
output = self._run("devtool sdk-update \"%s\"" % self.publish_dir)
@classmethod
def tearDownClass(self):
self.http_service.stop()

View File

@ -107,7 +107,7 @@ def check_manifest(fn, basepath):
return changedfiles
def sdk_update(args, config, basepath, workspace):
# Fetch locked-sigs.inc file from remote/local destination
"""Entry point for devtool sdk-update command"""
updateserver = args.updateserver
if not updateserver:
updateserver = config.get('SDK', 'updateserver', '')
@ -122,10 +122,9 @@ def sdk_update(args, config, basepath, workspace):
else:
logger.debug("Found conf/locked-sigs.inc in %s" % basepath)
if ':' in updateserver:
is_remote = True
else:
is_remote = False
if not '://' in updateserver:
logger.error("Update server must be a URL")
return -1
layers_dir = os.path.join(basepath, 'layers')
conf_dir = os.path.join(basepath, 'conf')
@ -139,41 +138,6 @@ def sdk_update(args, config, basepath, workspace):
finally:
tinfoil.shutdown()
if not is_remote:
# devtool sdk-update /local/path/to/latest/sdk
new_locked_sig_file_path = os.path.join(updateserver, 'conf/locked-sigs.inc')
if not os.path.exists(new_locked_sig_file_path):
logger.error("%s doesn't exist or is not an extensible SDK" % updateserver)
return -1
else:
logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
logger.debug("update_dict = %s" % update_dict)
newsdk_path = updateserver
sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
if not os.path.exists(sstate_dir):
logger.error("sstate-cache directory not found under %s" % newsdk_path)
return 1
sstate_objects = get_sstate_objects(update_dict, sstate_dir)
logger.debug("sstate_objects = %s" % sstate_objects)
if len(sstate_objects) == 0:
logger.info("No need to update.")
return 0
logger.info("Installing sstate objects into %s", basepath)
install_sstate_objects(sstate_objects, updateserver.rstrip('/'), basepath)
logger.info("Updating configuration files")
new_conf_dir = os.path.join(updateserver, 'conf')
shutil.rmtree(conf_dir)
shutil.copytree(new_conf_dir, conf_dir)
logger.info("Updating layers")
new_layers_dir = os.path.join(updateserver, 'layers')
shutil.rmtree(layers_dir)
ret = subprocess.call("cp -a %s %s" % (new_layers_dir, layers_dir), shell=True)
if ret != 0:
logger.error("Copying %s to %s failed" % (new_layers_dir, layers_dir))
return ret
else:
# devtool sdk-update http://myhost/sdk
tmpsdk_dir = tempfile.mkdtemp()
try:
os.makedirs(os.path.join(tmpsdk_dir, 'conf'))