'Given a package name, sort component (e.g, version, compiler, ...),
and an optional vpkg, return the list from the packages config.'

@classmethod
def _order_for_package(cls, pkgname, component, vpkg=None, all=True):

    pkglist = [pkgname]
    if all:
        pkglist.append('all')
    for pkg in pkglist:
        pkg_entry = cls._packages_config.get(pkg)
        if (not pkg_entry):
            continue
        order = pkg_entry.get(component)
        if (not order):
            continue
        if (vpkg is not None):
            order = order.get(vpkg)
        if order:
            return [str(s).strip() for s in order]
    return []
