mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
db-use.eclass: Use ESYSROOT rather than EPREFIX where appropriate
EPREFIX would be appropriate for values used at runtime. db_findver and db_libname check for the presence of files or directories at build time. db_includedir returns a header directory, which would almost certainly only be used at build time. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
This commit is contained in:
@@ -52,7 +52,7 @@ db_findver() {
|
||||
|
||||
PKG="$(best_version $1)"
|
||||
VER="$(ver_cut 1-2 "${PKG/*db-/}")"
|
||||
if [ -d "${EPREFIX}"/usr/include/db$(db_ver_to_slot "$VER") ]; then
|
||||
if [ -d "${ESYSROOT}"/usr/include/db$(db_ver_to_slot "$VER") ]; then
|
||||
#einfo "Found db version ${VER}" >&2
|
||||
echo -n "$VER"
|
||||
return 0
|
||||
@@ -71,8 +71,8 @@ db_includedir() {
|
||||
VER="$(db_findver sys-libs/db)" || return 1
|
||||
VER="$(db_ver_to_slot "$VER")"
|
||||
echo "include version ${VER}" >&2
|
||||
if [ -d "${EPREFIX}/usr/include/db${VER}" ]; then
|
||||
echo -n "${EPREFIX}/usr/include/db${VER}"
|
||||
if [ -d "${ESYSROOT}/usr/include/db${VER}" ]; then
|
||||
echo -n "${ESYSROOT}/usr/include/db${VER}"
|
||||
return 0
|
||||
else
|
||||
eerror "sys-libs/db package requested, but headers not found" >&2
|
||||
@@ -83,8 +83,8 @@ db_includedir() {
|
||||
for x in $@
|
||||
do
|
||||
if VER=$(db_findver "=sys-libs/db-${x}*") &&
|
||||
[ -d "${EPREFIX}/usr/include/db$(db_ver_to_slot $VER)" ]; then
|
||||
echo -n "${EPREFIX}/usr/include/db$(db_ver_to_slot $VER)"
|
||||
[ -d "${ESYSROOT}/usr/include/db$(db_ver_to_slot $VER)" ]; then
|
||||
echo -n "${ESYSROOT}/usr/include/db$(db_ver_to_slot $VER)"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
@@ -102,7 +102,7 @@ db_includedir() {
|
||||
db_libname() {
|
||||
if [ $# -eq 0 ]; then
|
||||
VER="$(db_findver sys-libs/db)" || return 1
|
||||
if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
|
||||
if [ -e "${ESYSROOT}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
|
||||
echo -n "db-${VER}"
|
||||
return 0
|
||||
else
|
||||
@@ -114,7 +114,7 @@ db_libname() {
|
||||
for x in $@
|
||||
do
|
||||
if VER=$(db_findver "=sys-libs/db-${x}*"); then
|
||||
if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
|
||||
if [ -e "${ESYSROOT}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
|
||||
echo -n "db-${VER}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user