mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
devtool: refactor deploy to use exec_fakeroot_no_d
This is a step towards a deploy function which can be called without passing the d variable. (From OE-Core rev: 3e8c41ec373a1766f68932d3b979d00e4e3bb3a9) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
c17ce99a2f
commit
50618e59dd
@@ -16,7 +16,7 @@ import bb.utils
|
||||
import argparse_oe
|
||||
import oe.types
|
||||
|
||||
from devtool import exec_fakeroot, setup_tinfoil, check_workspace_recipe, DevtoolError
|
||||
from devtool import exec_fakeroot_no_d, setup_tinfoil, check_workspace_recipe, DevtoolError
|
||||
|
||||
logger = logging.getLogger('devtool')
|
||||
|
||||
@@ -160,19 +160,22 @@ def deploy(args, config, basepath, workspace):
|
||||
except Exception as e:
|
||||
raise DevtoolError('Exception parsing recipe %s: %s' %
|
||||
(args.recipename, e))
|
||||
|
||||
recipe_outdir = rd.getVar('D')
|
||||
if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir):
|
||||
raise DevtoolError('No files to deploy - have you built the %s '
|
||||
'recipe? If so, the install step has not installed '
|
||||
'any files.' % args.recipename)
|
||||
|
||||
fakerootcmd = rd.getVar('FAKEROOTCMD')
|
||||
fakerootenv = rd.getVar('FAKEROOTENV')
|
||||
if args.strip and not args.dry_run:
|
||||
# Fakeroot copy to new destination
|
||||
srcdir = recipe_outdir
|
||||
recipe_outdir = os.path.join(rd.getVar('WORKDIR'), 'devtool-deploy-target-stripped')
|
||||
if os.path.isdir(recipe_outdir):
|
||||
exec_fakeroot(rd, "rm -rf %s" % recipe_outdir, shell=True)
|
||||
exec_fakeroot(rd, "cp -af %s %s" % (os.path.join(srcdir, '.'), recipe_outdir), shell=True)
|
||||
exec_fakeroot_no_d(fakerootcmd, fakerootenv, "rm -rf %s" % recipe_outdir, shell=True)
|
||||
exec_fakeroot_no_d(fakerootcmd, fakerootenv, "cp -af %s %s" % (os.path.join(srcdir, '.'), recipe_outdir), shell=True)
|
||||
os.environ['PATH'] = ':'.join([os.environ['PATH'], rd.getVar('PATH') or ''])
|
||||
oe.package.strip_execs(args.recipename, recipe_outdir, rd.getVar('STRIP'), rd.getVar('libdir'),
|
||||
rd.getVar('base_libdir'), oe.utils.get_bb_number_threads(rd), rd)
|
||||
@@ -251,7 +254,7 @@ def deploy(args, config, basepath, workspace):
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
# Now run the script
|
||||
ret = exec_fakeroot(rd, 'tar cf - . | %s %s %s %s \'sh %s %s %s %s\'' % (ssh_sshexec, ssh_port, extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
|
||||
ret = exec_fakeroot_no_d(fakerootcmd, fakerootenv, 'tar cf - . | %s %s %s %s \'sh %s %s %s %s\'' % (ssh_sshexec, ssh_port, extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
|
||||
if ret != 0:
|
||||
raise DevtoolError('Deploy failed - rerun with -s to get a complete '
|
||||
'error message')
|
||||
|
||||
Reference in New Issue
Block a user