From 456dbeaab3e2f71f527eae542ab44d1e372b0655 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 10 Jan 2018 05:25:01 +0000 Subject: gentoo resync : 10.01.2018 --- eclass/Manifest.gz | Bin 41197 -> 41362 bytes eclass/eutils.eclass | 77 +++----------------------------------------- eclass/preserve-libs.eclass | 74 ++++++++++++++++++++++++++++++++++++++++++ eclass/versionator.eclass | 4 +-- 4 files changed, 80 insertions(+), 75 deletions(-) create mode 100644 eclass/preserve-libs.eclass (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index 1dc0576569ae..e8ffc18752c2 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 7d4193e76b51..63f73db290f4 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: eutils.eclass @@ -20,7 +20,7 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit desktop epatch estack ltprune multilib toolchain-funcs + inherit desktop epatch estack ltprune multilib preserve-libs toolchain-funcs ;; esac @@ -164,75 +164,6 @@ strip-linguas() { export LINGUAS=${newls:1} } -# @FUNCTION: _eutils_eprefix_init -# @INTERNAL -# @DESCRIPTION: -# Initialized prefix variables for EAPI<3. -_eutils_eprefix_init() { - has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}} -} - -# @FUNCTION: preserve_old_lib -# @USAGE: [more libs] -# @DESCRIPTION: -# These functions are useful when a lib in your package changes ABI SONAME. -# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0 -# would break packages that link against it. Most people get around this -# by using the portage SLOT mechanism, but that is not always a relevant -# solution, so instead you can call this from pkg_preinst. See also the -# preserve_old_lib_notify function. -preserve_old_lib() { - _eutils_eprefix_init - if [[ ${EBUILD_PHASE} != "preinst" ]] ; then - eerror "preserve_old_lib() must be called from pkg_preinst() only" - die "Invalid preserve_old_lib() usage" - fi - [[ -z $1 ]] && die "Usage: preserve_old_lib [more libraries to preserve]" - - # let portage worry about it - has preserve-libs ${FEATURES} && return 0 - - local lib dir - for lib in "$@" ; do - [[ -e ${EROOT}/${lib} ]] || continue - dir=${lib%/*} - dodir ${dir} || die "dodir ${dir} failed" - cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed" - touch "${ED}"/${lib} - done -} - -# @FUNCTION: preserve_old_lib_notify -# @USAGE: [more libs] -# @DESCRIPTION: -# Spit helpful messages about the libraries preserved by preserve_old_lib. -preserve_old_lib_notify() { - if [[ ${EBUILD_PHASE} != "postinst" ]] ; then - eerror "preserve_old_lib_notify() must be called from pkg_postinst() only" - die "Invalid preserve_old_lib_notify() usage" - fi - - # let portage worry about it - has preserve-libs ${FEATURES} && return 0 - - _eutils_eprefix_init - - local lib notice=0 - for lib in "$@" ; do - [[ -e ${EROOT}/${lib} ]] || continue - if [[ ${notice} -eq 0 ]] ; then - notice=1 - ewarn "Old versions of installed libraries were detected on your system." - ewarn "In order to avoid breaking packages that depend on these old libs," - ewarn "the libraries are not being removed. You need to run revdep-rebuild" - ewarn "in order to remove these old dependencies. If you do not have this" - ewarn "helper program, simply emerge the 'gentoolkit' package." - ewarn - fi - ewarn " # revdep-rebuild --library '${lib}' && rm '${lib}'" - done -} - # @FUNCTION: built_with_use # @USAGE: [--hidden] [--missing ] [-a|-o] # @DESCRIPTION: @@ -255,7 +186,6 @@ preserve_old_lib_notify() { # Remember that this function isn't terribly intelligent so order of optional # flags matter. built_with_use() { - _eutils_eprefix_init local hidden="no" if [[ $1 == "--hidden" ]] ; then hidden="yes" @@ -279,6 +209,7 @@ built_with_use() { [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" shift + has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT} local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE @@ -333,9 +264,9 @@ built_with_use() { # first optionally setting LD_LIBRARY_PATH to the colon-delimited # libpaths followed by optionally changing directory to chdir. make_wrapper() { - _eutils_eprefix_init local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 local tmpwrapper=$(emktemp) + has "${EAPI:-0}" 0 1 2 && local EPREFIX="" ( echo '#!/bin/sh' diff --git a/eclass/preserve-libs.eclass b/eclass/preserve-libs.eclass new file mode 100644 index 000000000000..548c6411fcf0 --- /dev/null +++ b/eclass/preserve-libs.eclass @@ -0,0 +1,74 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: preserve-libs.eclass +# @MAINTAINER: +# base-system@gentoo.org +# @BLURB: preserve libraries after SONAME changes + +if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then +_PRESERVE_LIBS_ECLASS=1 + +# @FUNCTION: preserve_old_lib +# @USAGE: [more libs] +# @DESCRIPTION: +# These functions are useful when a lib in your package changes ABI SONAME. +# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0 +# would break packages that link against it. Most people get around this +# by using the portage SLOT mechanism, but that is not always a relevant +# solution, so instead you can call this from pkg_preinst. See also the +# preserve_old_lib_notify function. +preserve_old_lib() { + if [[ ${EBUILD_PHASE} != "preinst" ]] ; then + eerror "preserve_old_lib() must be called from pkg_preinst() only" + die "Invalid preserve_old_lib() usage" + fi + [[ -z $1 ]] && die "Usage: preserve_old_lib [more libraries to preserve]" + + # let portage worry about it + has preserve-libs ${FEATURES} && return 0 + + has "${EAPI:-0}" 0 1 2 && local ED=${D} EROOT=${ROOT} + + local lib dir + for lib in "$@" ; do + [[ -e ${EROOT}/${lib} ]] || continue + dir=${lib%/*} + dodir ${dir} || die "dodir ${dir} failed" + cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed" + touch "${ED}"/${lib} + done +} + +# @FUNCTION: preserve_old_lib_notify +# @USAGE: [more libs] +# @DESCRIPTION: +# Spit helpful messages about the libraries preserved by preserve_old_lib. +preserve_old_lib_notify() { + if [[ ${EBUILD_PHASE} != "postinst" ]] ; then + eerror "preserve_old_lib_notify() must be called from pkg_postinst() only" + die "Invalid preserve_old_lib_notify() usage" + fi + + # let portage worry about it + has preserve-libs ${FEATURES} && return 0 + + has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT} + + local lib notice=0 + for lib in "$@" ; do + [[ -e ${EROOT}/${lib} ]] || continue + if [[ ${notice} -eq 0 ]] ; then + notice=1 + ewarn "Old versions of installed libraries were detected on your system." + ewarn "In order to avoid breaking packages that depend on these old libs," + ewarn "the libraries are not being removed. You need to run revdep-rebuild" + ewarn "in order to remove these old dependencies. If you do not have this" + ewarn "helper program, simply emerge the 'gentoolkit' package." + ewarn + fi + ewarn " # revdep-rebuild --library '${lib}' && rm '${lib}'" + done +} + +fi diff --git a/eclass/versionator.eclass b/eclass/versionator.eclass index 7c03c1e1b23a..54d77a30b015 100644 --- a/eclass/versionator.eclass +++ b/eclass/versionator.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: versionator.eclass @@ -28,7 +28,7 @@ if [[ -z ${_VERSIONATOR_ECLASS} ]]; then _VERSIONATOR_ECLASS=1 -inherit eutils +inherit estack # @FUNCTION: get_all_version_components # @USAGE: [version] -- cgit v1.2.3