summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2018-08-16 23:01:19 +0100
committerBertrand Jacquin <bertrand@jacquin.bzh>2018-08-16 23:43:27 +0100
commit7acc786ea1a6570cd8e1586ba8303ad6c4379348 (patch)
tree6bbb333b60e8e6fe0aa755d1da104c3bef21e69d /eclass
parenteclass/linux-build: Restore previous configuration to the right place (diff)
downloadportage-7acc786ea1a6570cd8e1586ba8303ad6c4379348.tar.xz
eclass/linux-build: Simplify retrieval of previous version
Diffstat (limited to 'eclass')
-rw-r--r--eclass/linux-build.eclass35
1 files changed, 23 insertions, 12 deletions
diff --git a/eclass/linux-build.eclass b/eclass/linux-build.eclass
index 69129de7..4442d31d 100644
--- a/eclass/linux-build.eclass
+++ b/eclass/linux-build.eclass
@@ -66,6 +66,27 @@ _linux-build_configval() {
esac
}
+_linux-build_get-portage-versions() {
+ local -a _v
+ local _rv
+
+ if [[ "${PF}" != "${P}" ]] ; then
+ _v+=( "${PF}" )
+ fi
+
+ _v+=( "${P}" )
+
+ if [[ -n "${REPLACING_VERSIONS}" ]] ; then
+ for _rv in ${REPLACING_VERSIONS} ; do
+ _v+=( "${PN}-${_rv}" )
+ done
+ fi
+
+ _v+=( "${PN}" )
+
+ echo "${_v[@]}"
+}
+
_linux-build_pkg_setup-build-config() {
local _v
@@ -79,7 +100,7 @@ _linux-build_pkg_setup-build-config() {
return 0
fi
- for _v in "${PF}" "${P}" "${PN}" ; do
+ for _v in $(_linux-build_get-portage-versions) ; do
einfo "Checking existence of ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${_v}"
if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${_v}" ]] ; then
eend 0
@@ -96,23 +117,13 @@ _linux-build_pkg_setup-build-config() {
eend 1
done
- for _v in ${REPLACING_VERSIONS} ; do
- einfo "Checking existence of ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}"
- if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" ]] ; then
- cp "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" \
- "${T}/config"
- eend 0
- return 0
- fi
- done
-
return 1
}
_linux-build_pkg_setup-build-x509() {
local _v
- for _v in "${PF}" "${P}" "${PN}" ; do
+ for _v in $(_linux-build_get-portage-versions) ; do
einfo "Checking existence of ${PORTAGE_CONFIGROOT%/}/etc/ssl/private/${_v}.pem"
if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/ssl/private/${_v}.pem" ]] ; then