profiles/coreos/base: slsa: use portageq to find repository path

This makes the lookup work within the catalyst chroot, as well as in the
SDK.
This commit is contained in:
jenkins 2022-07-13 11:37:40 +00:00 committed by Jeremi Piotrowski
parent d86d5ebe3f
commit 7bd2f19fac

View File

@ -43,11 +43,10 @@ __slsa_provenance_subject() {
__slsa_provenance_materials() {
local csum="" uri="" repo="" ebuild=""
local ebuilds_basedir="/mnt/host/source/src/third_party/"
local ebuild="${CATEGORY}/${PN}/${PF}.ebuild"
if [ -f "${ebuilds_basedir}/coreos-overlay/${ebuild}" ] ; then
if [ -f "$(portageq get_repo_path ${ROOT:-/} coreos)/${ebuild}" ] ; then
repo="coreos-overlay"
elif [ -f "${ebuilds_basedir}/portage-stable/${ebuild}" ] ; then
elif [ -f "$(portageq get_repo_path ${ROOT:-/} portage-stable)/${ebuild}" ] ; then
repo="portage-stable"
else
eerror "SLSA provenance: Unable to detect ebuild repository for package '${ebuild}'"