Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 579626

Summary: sys-apps/portage: EAPI=6 empty PATCHES array fails to work
Product: Portage Development Reporter: Matthew Thode ( prometheanfire ) <prometheanfire>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: chutzpah, polynomial-c
Priority: Normal Keywords: Bug, InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 563798, 573774    

Description Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-04-11 15:03:15 UTC
Not sure if this is limited to also using distutils-r1 or not but all you should have to do is have this in your ebuild to reproduce

'
PATCHES=(

)
Comment 1 Zac Medico gentoo-dev 2016-04-20 18:45:50 UTC
The spec says the default src_prepare should look like this:

src_prepare() {  
    if declare -p PATCHES | grep -q "^declare -a "; then  
        [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"  
    else  
        [[ -n ${PATCHES} ]] && eapply ${PATCHES}  
    fi  
    eapply_user  
}

Here's what we currently have:

__eapi6_src_prepare() {
	if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
		eapply "${PATCHES[@]}"
	elif [[ -n ${PATCHES} ]]; then
		eapply ${PATCHES}
	fi

	eapply_user
}
Comment 2 Zac Medico gentoo-dev 2016-04-20 19:01:01 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_579626

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/f2efa8da238b727c478fb06910bbd8fd
Comment 4 Zac Medico gentoo-dev 2017-03-16 23:07:59 UTC
Fixed in portage-2.3.0.