mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2025-07-19 20:59:02 +02:00

[RP: Minor tweaks made to adpat to buildbot and option naming Fixed shared-repo-unpack for publishing when no cache-dir supplied] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
56 lines
1.7 KiB
Python
Executable File
56 lines
1.7 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
#
|
|
# Move the repositories into the correct layout and generate bblayers.conf
|
|
#
|
|
|
|
import json
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
import errno
|
|
|
|
import utils
|
|
|
|
|
|
parser = utils.ArgParser(description='Moves the repositories into the correct layout and generates bblayers.conf.')
|
|
|
|
parser.add_argument('abworkdir',
|
|
help="The autobuilder working directory")
|
|
parser.add_argument('target',
|
|
help="The target to filter the repos to")
|
|
|
|
args = parser.parse_args()
|
|
|
|
ourconfig = utils.loadconfig()
|
|
|
|
def bitbakecmd(targetdir, cmd):
|
|
ret = subprocess.call(". ./oe-init-build-env; %s" % cmd, shell=True, cwd=targetdir)
|
|
if ret:
|
|
utils.printheader("ERROR: Command %s failed with exit code %d, see errors above." % (cmd, ret))
|
|
|
|
needrepos = utils.getconfigvar("NEEDREPOS", ourconfig, args.target, None)
|
|
|
|
callinit = False
|
|
|
|
repos = utils.getconfig("repo-defaults", ourconfig)
|
|
|
|
for repo in needrepos:
|
|
checkdir = repo
|
|
if repo in repos:
|
|
if "call-init" in repos[repo] and repos[repo]["call-init"]:
|
|
callinit = True
|
|
if "checkout-dirname" in repos[repo]:
|
|
checkdir = repos[repo]["checkout-dirname"]
|
|
utils.mkdir(args.abworkdir + "/" + checkdir)
|
|
for f in os.listdir(args.abworkdir + "/repos/" + repo):
|
|
subprocess.check_call(['mv', args.abworkdir + "/repos/" + repo + "/" + f, args.abworkdir + "/" + checkdir + "/"])
|
|
|
|
if callinit:
|
|
subprocess.check_call(". ./oe-init-build-env", shell=True, cwd=args.abworkdir)
|
|
|
|
for repo in needrepos:
|
|
if repo in repos and "no-layer-add" in repos[repo] and repos[repo]["no-layer-add"]:
|
|
continue
|
|
bitbakecmd(args.abworkdir, "bitbake-layers add-layer %s" % (args.abworkdir + "/" + repo))
|
|
|