/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.266 Revision 1.267
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.266 2007/01/04 22:14:34 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.267 2007/01/09 15:47:47 vapier Exp $
4# 4#
5# This eclass is for general purpose functions that most ebuilds 5# This eclass is for general purpose functions that most ebuilds
6# have to implement themselves. 6# have to implement themselves.
7# 7#
8# NB: If you add anything, please comment it! 8# NB: If you add anything, please comment it!
1536# an example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0 1536# an example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0
1537# would break packages that link against it. Most people get around this 1537# would break packages that link against it. Most people get around this
1538# by using the portage SLOT mechanism, but that is not always a relevant 1538# by using the portage SLOT mechanism, but that is not always a relevant
1539# solution, so instead you can add the following to your ebuilds: 1539# solution, so instead you can add the following to your ebuilds:
1540# 1540#
1541# src_install() { 1541# pkg_preinst() {
1542# ... 1542# ...
1543# preserve_old_lib /usr/$(get_libdir)/libogg.so.0 1543# preserve_old_lib /usr/$(get_libdir)/libogg.so.0
1544# ... 1544# ...
1545# } 1545# }
1546# 1546#
1549# preserve_old_lib_notify /usr/$(get_libdir)/libogg.so.0 1549# preserve_old_lib_notify /usr/$(get_libdir)/libogg.so.0
1550# ... 1550# ...
1551# } 1551# }
1552 1552
1553preserve_old_lib() { 1553preserve_old_lib() {
1554 LIB=$1 1554 if [[ ${EBUILD_PHASE} != "pkg_preinst" ]] ; then
1555 eerror "preserve_old_lib() must be called from pkg_preinst() only"
1556# die "Invalid preserve_old_lib() usage"
1557 fi
1558 [[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]"
1555 1559
1556 if [ -n "${LIB}" -a -f "${ROOT}${LIB}" ]; then 1560 local lib dir
1557 SONAME=`basename ${LIB}` 1561 for lib in "$@" ; do
1558 DIRNAME=`dirname ${LIB}` 1562 [[ -e ${ROOT}/${lib} ]] || continue
1559 1563 dir=${lib%/*}
1560 dodir ${DIRNAME} 1564 dodir ${dir} || die "dodir ${dir} failed"
1561 cp ${ROOT}${LIB} ${D}${DIRNAME} 1565 cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed"
1562 touch ${D}${LIB} 1566 touch "${D}"/${lib}
1563 fi 1567 done
1564} 1568}
1565 1569
1566preserve_old_lib_notify() { 1570preserve_old_lib_notify() {
1567 LIB=$1 1571 if [[ ${EBUILD_PHASE} != "pkg_postinst" ]] ; then
1572 eerror "preserve_old_lib_notify() must be called from pkg_postinst() only"
1573# die "Invalid preserve_old_lib_notify() usage"
1574 fi
1568 1575
1569 if [ -n "${LIB}" -a -f "${ROOT}${LIB}" ]; then 1576 local lib notice=0
1570 SONAME=`basename ${LIB}` 1577 for lib in "$@" ; do
1571 1578 [[ -e ${ROOT}/${lib} ]] || continue
1579 if [[ ${notice} -eq 0 ]] ; then
1580 notice=1
1572 ewarn "An old version of an installed library was detected on your system." 1581 ewarn "Old versions of installed libraries were detected on your system."
1573 ewarn "In order to avoid breaking packages that link against it, this older version" 1582 ewarn "In order to avoid breaking packages that depend on these old libs,"
1574 ewarn "is not being removed. In order to make full use of this newer version," 1583 ewarn "the libraries are not being removed. You need to run revdep-rebuild"
1575 ewarn "you will need to execute the following command:" 1584 ewarn "in order to remove these old dependencies. If you do not have this"
1576 ewarn " revdep-rebuild --library ${SONAME}" 1585 ewarn "helper program, simply emerge the 'gentoolkit' package."
1577 ewarn 1586 ewarn
1578 ewarn "After doing that, you can safely remove ${LIB}"
1579 ewarn "Note: 'emerge gentoolkit' to get revdep-rebuild"
1580 fi 1587 fi
1588 ewarn " # revdep-rebuild --library ${lib##*/}"
1589 done
1581} 1590}
1582 1591
1583# Hack for people to figure out if a package was built with 1592# Hack for people to figure out if a package was built with
1584# certain USE flags 1593# certain USE flags
1585# 1594#

Legend:
Removed from v.1.266  
changed lines
  Added in v.1.267

  ViewVC Help
Powered by ViewVC 1.1.20