Hi,

We've been trying out a setup using multiconfigs to select the source control branch some set of recipes to build. The building part goes well, but whenever we run package-index, the packages built using this scheme are deleted.

The basic setup is that we have one multiconfig per branch ('master', 'staging' etc.) In addition to providing the name of the branch, they are also used to configure some variables like PACKAGE_FEED_URIS. Next, we have a class that basically looks like this (the 'master' config was originally called 'devel'):

"""
def select_branch(d):
    branch = d.getVar('BB_CURRENT_MC', True)
    if branch == 'default' or branch == 'devel':
        branch = 'master'

    if not branch:
        branch = 'master'
    return branch

MC_BRANCH ?= "${@select_branch(d)}"
"""

In the recipe we have something like the following:
inherit git-multiconfig # our class
inherit gitpkgv

SRCREV = "${AUTOREV}"
PV = "${FOO_VERSION}.0+gitr${SRCPV}"
PKGV = "${MC_BRANCH}-${FOO_VERSION}.0+${GITPKGV}"
SRC_URI += "gitsm://git@repo/foo.git;protocol=ssh;branch=${MC_BRANCH}"

As stated above, when a specific recipe is built (bitbake multiconfig:master:foo), everything looks fine, but whenever package-index is run (with or without multiconfig), all rpms built using this scheme will be deleted.

If the MC_BRANCH variable is hardcoded inside the class (eg. changing the body of select_branch() to a single return statement) things work as expected. Any suggestions on what's going on, and how to fix it (or do it in a better way)? The ultimate goal is being able to build multiple branches of our project without having to encode or duplicate that information, ideally receiving it as a parameter from the CI system.

Regards,
Anders Montonen
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to