# This create the same variable for CoreOS as defined by metadata_scm.bbclass
# for OpenEmbedded-Core

# Note that metadata_scm.bbclass is already ihnerited by the base class, so we
# don't need to add it here.

def coreos_get_scmbasepath(d):
    return d.getVar('COREOS_ROOT')

def coreos_detect_revision(d):
    path = coreos_get_scmbasepath(d)
    return base_get_metadata_git_revision(path, d)

def coreos_detect_branch(d):
    path = coreos_get_scmbasepath(d)
    return base_get_metadata_git_branch(path, d)

COREOS_METADATA_BRANCH := "${@coreos_detect_branch(d)}"
COREOS_METADATA_REVISION := "${@coreos_detect_revision(d)}"
