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

Diff of /eclass/eutils.eclass

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

Revision 1.114 Revision 1.126
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.114 2004/10/06 04:21:08 usata Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.126 2004/12/08 01:31:38 vapier Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
221 local x="" 221 local x=""
222 222
223 if [ "$#" -gt 1 ] 223 if [ "$#" -gt 1 ]
224 then 224 then
225 local m="" 225 local m=""
226 einfo "${#} patches to apply..." 226 einfo "${#} patches to apply ..."
227 for m in "$@" ; do 227 for m in "$@" ; do
228 epatch "${m}" 228 epatch "${m}"
229 done 229 done
230 return 0 230 return 0
231 fi 231 fi
245 local EPATCH_SOURCE="$1/*" 245 local EPATCH_SOURCE="$1/*"
246 else 246 else
247 local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}" 247 local EPATCH_SOURCE="$1/*.${EPATCH_SUFFIX}"
248 fi 248 fi
249 else 249 else
250 if [ ! -d ${EPATCH_SOURCE} ] 250 if [ ! -d ${EPATCH_SOURCE} ] || [ -n "$1" ]
251 then 251 then
252 if [ -n "$1" -a "${EPATCH_SOURCE}" = "${WORKDIR}/patch" ] 252 if [ -n "$1" -a "${EPATCH_SOURCE}" = "${WORKDIR}/patch" ]
253 then 253 then
254 EPATCH_SOURCE="$1" 254 EPATCH_SOURCE="$1"
255 fi 255 fi
284 ;; 284 ;;
285 esac 285 esac
286 286
287 if [ "${SINGLE_PATCH}" = "no" ] 287 if [ "${SINGLE_PATCH}" = "no" ]
288 then 288 then
289 einfo "Applying various patches (bugfixes/updates)..." 289 einfo "Applying various patches (bugfixes/updates) ..."
290 fi 290 fi
291 for x in ${EPATCH_SOURCE} 291 for x in ${EPATCH_SOURCE}
292 do 292 do
293 # New ARCH dependant patch naming scheme... 293 # New ARCH dependant patch naming scheme ...
294 # 294 #
295 # ???_arch_foo.patch 295 # ???_arch_foo.patch
296 # 296 #
297 if [ -f ${x} ] && \ 297 if [ -f ${x} ] && \
298 ([ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] || \ 298 ([ "${SINGLE_PATCH}" = "yes" -o "${x/_all_}" != "${x}" -o "`eval echo \$\{x/_${ARCH}_\}`" != "${x}" ] || \
313 then 313 then
314 if [ -n "${EPATCH_SINGLE_MSG}" ] 314 if [ -n "${EPATCH_SINGLE_MSG}" ]
315 then 315 then
316 einfo "${EPATCH_SINGLE_MSG}" 316 einfo "${EPATCH_SINGLE_MSG}"
317 else 317 else
318 einfo "Applying ${x##*/}..." 318 einfo "Applying ${x##*/} ..."
319 fi 319 fi
320 else 320 else
321 einfo " ${x##*/}..." 321 einfo " ${x##*/} ..."
322 fi 322 fi
323 323
324 echo "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 324 echo "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}
325 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 325 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}
326 326
359 359
360 if (cat ${PATCH_TARGET} | patch -p${count} ${popts} --dry-run -f) >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1 360 if (cat ${PATCH_TARGET} | patch -p${count} ${popts} --dry-run -f) >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/} 2>&1
361 then 361 then
362 draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 362 draw_line "***** ${x##*/} *****" > ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
363 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 363 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
364 echo "ACTUALLY APPLYING ${x##*/}..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 364 echo "ACTUALLY APPLYING ${x##*/} ..." >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
365 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 365 echo >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
366 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 366 draw_line "***** ${x##*/} *****" >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real
367 367
368 cat ${PATCH_TARGET} | patch -p${count} ${popts} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1 368 cat ${PATCH_TARGET} | patch -p${count} ${popts} >> ${STDERR_TARGET%/*}/${x##*/}-${STDERR_TARGET##*/}.real 2>&1
369 369
438 438
439 return 1; 439 return 1;
440 } 440 }
441 END 441 END
442 442
443 einfon "Checking for _CS_GNU_LIBPTHREAD_VERSION support in glibc ... " 443 einfon "Checking for _CS_GNU_LIBPTHREAD_VERSION support in glibc ..."
444 if gcc -o ${T}/nptl ${T}/test-nptl.c &> /dev/null 444 if gcc -o ${T}/nptl ${T}/test-nptl.c &> /dev/null
445 then 445 then
446 echo "yes" 446 echo "yes"
447 einfon "Checking what PTHREADS implementation we have ... " 447 einfon "Checking what PTHREADS implementation we have ..."
448 if ${T}/nptl 448 if ${T}/nptl
449 then 449 then
450 return 0 450 return 0
451 else 451 else
452 return 1 452 return 1
528 528
529 if [ -n "${ADMINPARAM}" ] 529 if [ -n "${ADMINPARAM}" ]
530 then 530 then
531 if [ "${jobs}" -gt "${ADMINPARAM}" ] 531 if [ "${jobs}" -gt "${ADMINPARAM}" ]
532 then 532 then
533 einfo "Setting make jobs to \"-j${ADMINPARAM}\" to ensure successful merge..." 533 einfo "Setting make jobs to \"-j${ADMINPARAM}\" to ensure successful merge ..."
534 export MAKEOPTS="${MAKEOPTS} -j${ADMINPARAM}" 534 export MAKEOPTS="${MAKEOPTS} -j${ADMINPARAM}"
535 else 535 else
536 einfo "Setting make jobs to \"-j${jobs}\" to ensure successful merge..." 536 einfo "Setting make jobs to \"-j${jobs}\" to ensure successful merge ..."
537 export MAKEOPTS="${MAKEOPTS} -j${jobs}" 537 export MAKEOPTS="${MAKEOPTS} -j${jobs}"
538 fi 538 fi
539 fi 539 fi
540} 540}
541 541
542# Cheap replacement for when debianutils (and thus mktemp) 542# Cheap replacement for when debianutils (and thus mktemp)
543# does not exist on the users system 543# does not exist on the users system
544# vapier@gentoo.org 544# vapier@gentoo.org
545# 545#
546# Takes just 1 parameter (the directory to create tmpfile in) 546# Takes just 1 optional parameter (the directory to create tmpfile in)
547mymktemp() { 547emktemp() {
548 local exe="touch"
549 [ "$1" == "-d" ] && exe="mkdir" && shift
548 local topdir="$1" 550 local topdir="$1"
549 551
550 [ -z "${topdir}" ] && topdir=/tmp 552 if [ -z "${topdir}" ]
551 if [ "`which mktemp 2>/dev/null`" ]
552 then 553 then
553 mktemp -p ${topdir} 554 [ -z "${T}" ] \
554 else 555 && topdir="/tmp" \
556 || topdir="${T}"
557 fi
558
559 if [ -z "$(type -p mktemp)" ]
560 then
561 local tmp=/
562 while [ -e "${tmp}" ] ; do
555 local tmp="${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}" 563 tmp="${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}"
556 touch ${tmp} 564 done
565 ${exe} "${tmp}"
557 echo ${tmp} 566 echo "${tmp}"
567 else
568 [ "${exe}" == "touch" ] \
569 && exe="-p" \
570 || exe="-d"
571 mktemp ${exe} "${topdir}"
558 fi 572 fi
559} 573}
560 574
561# Small wrapper for getent (Linux), nidump (Mac OS X), 575# Small wrapper for getent (Linux), nidump (Mac OS X),
562# and pw (FreeBSD) used in enewuser()/enewgroup() 576# and pw (FreeBSD) used in enewuser()/enewgroup()
563# Joe Jezak <josejx@gmail.com> and usata@gentoo.org 577# Joe Jezak <josejx@gmail.com> and usata@gentoo.org
564# FBSD stuff: Aaron Walker <ka0ttic@gentoo.org> 578# FBSD stuff: Aaron Walker <ka0ttic@gentoo.org>
565# 579#
566# egetent(database, key) 580# egetent(database, key)
567egetent() { 581egetent() {
568 if useq macos || useq ppc-macos ; then 582 if useq ppc-macos ; then
569 case "$2" in 583 case "$2" in
570 *[!0-9]*) # Non numeric 584 *[!0-9]*) # Non numeric
571 nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }" 585 nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }"
572 ;; 586 ;;
573 *) # Numeric 587 *) # Numeric
690 local defgroup="" exgroups="" 704 local defgroup="" exgroups=""
691 705
692 export IFS="," 706 export IFS=","
693 for g in ${egroups} 707 for g in ${egroups}
694 do 708 do
709 export IFS="${oldifs}"
695 if [ -z "`egetent group \"${g}\"`" ] 710 if [ -z "`egetent group \"${g}\"`" ]
696 then 711 then
697 eerror "You must add group ${g} to the system first" 712 eerror "You must add group ${g} to the system first"
698 die "${g} is not a valid GID" 713 die "${g} is not a valid GID"
699 fi 714 fi
701 then 716 then
702 defgroup="${g}" 717 defgroup="${g}"
703 else 718 else
704 exgroups="${exgroups},${g}" 719 exgroups="${exgroups},${g}"
705 fi 720 fi
721 export IFS=","
706 done 722 done
707 export IFS="${oldifs}" 723 export IFS="${oldifs}"
708 724
709 opts="${opts} -g ${defgroup}" 725 opts="${opts} -g ${defgroup}"
710 if [ ! -z "${exgroups}" ] 726 if [ ! -z "${exgroups}" ]
718 734
719 # handle extra and add the user 735 # handle extra and add the user
720 local eextra="$@" 736 local eextra="$@"
721 local oldsandbox="${SANDBOX_ON}" 737 local oldsandbox="${SANDBOX_ON}"
722 export SANDBOX_ON="0" 738 export SANDBOX_ON="0"
723 if useq macos || useq ppc-macos ; 739 if useq ppc-macos
724 then 740 then
725 ### Make the user 741 ### Make the user
726 if [ -z "${eextra}" ] 742 if [ -z "${eextra}" ]
727 then 743 then
728 dscl . create /users/${euser} uid ${euid} 744 dscl . create /users/${euser} uid ${euid}
729 dscl . create /users/${euser} shell ${eshell} 745 dscl . create /users/${euser} shell ${eshell}
730 dscl . create /users/${euser} home ${ehome} 746 dscl . create /users/${euser} home ${ehome}
731 dscl . create /users/${euser} realname "added by portage for ${PN}" 747 dscl . create /users/${euser} realname "added by portage for ${PN}"
732 ### Add the user to the groups specified 748 ### Add the user to the groups specified
749 local oldifs="${IFS}"
750 export IFS=","
733 for g in ${egroups} 751 for g in ${egroups}
734 do 752 do
735 # $egroups is , delimited, not space
736 ewarn "This is code is wrong; someone on the OS X team should fix it"
737 dscl . merge /groups/${g} users ${euser} 753 dscl . merge /groups/${g} users ${euser}
738 done 754 done
755 export IFS="${oldifs}"
739 else 756 else
740 einfo "Extra options are not supported on macos yet" 757 einfo "Extra options are not supported on macos yet"
741 einfo "Please report the ebuild along with the info below" 758 einfo "Please report the ebuild along with the info below"
742 einfo "eextra: ${eextra}" 759 einfo "eextra: ${eextra}"
743 die "Required function missing" 760 die "Required function missing"
810 then 827 then
811 if [ "${egid}" -gt 0 ] 828 if [ "${egid}" -gt 0 ]
812 then 829 then
813 if [ -z "`egetent group ${egid}`" ] 830 if [ -z "`egetent group ${egid}`" ]
814 then 831 then
815 if useq macos || useq ppc-macos ; then 832 if useq ppc-macos ; then
816 opts="${opts} ${egid}" 833 opts="${opts} ${egid}"
817 else 834 else
818 opts="${opts} -g ${egid}" 835 opts="${opts} -g ${egid}"
819 fi 836 fi
820 else 837 else
834 opts="${opts} ${eextra}" 851 opts="${opts} ${eextra}"
835 852
836 # add the group 853 # add the group
837 local oldsandbox="${SANDBOX_ON}" 854 local oldsandbox="${SANDBOX_ON}"
838 export SANDBOX_ON="0" 855 export SANDBOX_ON="0"
839 if useq macos || useq ppc-macos ; 856 if useq ppc-macos ; then
840 then
841 if [ ! -z "${eextra}" ]; 857 if [ ! -z "${eextra}" ];
842 then 858 then
843 einfo "Extra options are not supported on macos yet" 859 einfo "Extra options are not supported on macos yet"
844 einfo "Please report the ebuild along with the info below" 860 einfo "Please report the ebuild along with the info below"
845 einfo "eextra: ${eextra}" 861 einfo "eextra: ${eextra}"
870} 886}
871 887
872# Simple script to replace 'dos2unix' binaries 888# Simple script to replace 'dos2unix' binaries
873# vapier@gentoo.org 889# vapier@gentoo.org
874# 890#
875# edos2unix(file, <more files>...) 891# edos2unix(file, <more files> ...)
876edos2unix() { 892edos2unix() {
877 for f in "$@" 893 for f in "$@"
878 do 894 do
879 cp "${f}" ${T}/edos2unix 895 cp "${f}" ${T}/edos2unix
880 sed 's/\r$//' ${T}/edos2unix > "${f}" 896 sed 's/\r$//' ${T}/edos2unix > "${f}"
882} 898}
883 899
884# Make a desktop file ! 900# Make a desktop file !
885# Great for making those icons in kde/gnome startmenu ! 901# Great for making those icons in kde/gnome startmenu !
886# Amaze your friends ! Get the women ! Join today ! 902# Amaze your friends ! Get the women ! Join today !
887# gnome2 /usr/share/applications
888# gnome1 /usr/share/gnome/apps/
889# KDE ${KDEDIR}/share/applnk /usr/share/applnk
890# 903#
891# make_desktop_entry(<binary>, [name], [icon], [type], [path]) 904# make_desktop_entry(<binary>, [name], [icon], [type], [path])
892# 905#
893# binary: what binary does the app run with ? 906# binary: what binary does the app run with ?
894# name: the name that will show up in the menu 907# name: the name that will show up in the menu
895# icon: give your little like a pretty little icon ... 908# icon: give your little like a pretty little icon ...
896# this can be relative (to /usr/share/pixmaps) or 909# this can be relative (to /usr/share/pixmaps) or
897# a full path to an icon 910# a full path to an icon
898# type: what kind of application is this ? for categories: 911# type: what kind of application is this ? for categories:
899# http://www.freedesktop.org/standards/menu-spec/ 912# http://www.freedesktop.org/standards/menu-spec/
900# path: if your app needs to startup in a specific dir 913# path: if your app needs to startup in a specific dir
901make_desktop_entry() { 914make_desktop_entry() {
902 [ -z "$1" ] && eerror "You must specify the executable" && return 1 915 [ -z "$1" ] && eerror "make_desktop_entry: You must specify the executable" && return 1
903 916
904 local exec="${1}" 917 local exec="${1}"
905 local name="${2:-${PN}}" 918 local name="${2:-${PN}}"
906 local icon="${3:-${PN}.png}" 919 local icon="${3:-${PN}.png}"
907 local type="${4}" 920 local type="${4}"
939Exec=${exec} 952Exec=${exec}
940Path=${path} 953Path=${path}
941Icon=${icon} 954Icon=${icon}
942Categories=Application;${type};" > "${desktop}" 955Categories=Application;${type};" > "${desktop}"
943 956
944 if [ -d "/usr/share/applications" ]
945 then
946 insinto /usr/share/applications 957 insinto /usr/share/applications
947 doins "${desktop}" 958 doins "${desktop}"
948 fi
949
950 #if [ -d "/usr/share/gnome/apps" ]
951 #then
952 # insinto /usr/share/gnome/apps/Games
953 # doins ${desktop}
954 #fi
955
956 #if [ ! -z "`ls /usr/kde/* 2>/dev/null`" ]
957 #then
958 # for ver in /usr/kde/*
959 # do
960 # insinto ${ver}/share/applnk/Games
961 # doins ${desktop}
962 # done
963 #fi
964
965 if [ -d "/usr/share/applnk" ]
966 then
967 insinto /usr/share/applnk/${subdir}
968 doins "${desktop}"
969 fi
970 959
971 return 0 960 return 0
972} 961}
973 962
974# for internal use only (unpack_pdv and unpack_makeself) 963# for internal use only (unpack_pdv and unpack_makeself)
1023 echo ">>> Unpacking ${shrtsrc} to ${PWD}" 1012 echo ">>> Unpacking ${shrtsrc} to ${PWD}"
1024 local metaskip=`tail -c ${sizeoff_t} ${src} | hexdump -e \"%i\"` 1013 local metaskip=`tail -c ${sizeoff_t} ${src} | hexdump -e \"%i\"`
1025 local tailskip=`tail -c $((${sizeoff_t}*2)) ${src} | head -c ${sizeoff_t} | hexdump -e \"%i\"` 1014 local tailskip=`tail -c $((${sizeoff_t}*2)) ${src} | head -c ${sizeoff_t} | hexdump -e \"%i\"`
1026 1015
1027 # grab metadata for debug reasons 1016 # grab metadata for debug reasons
1028 local metafile="`mymktemp ${T}`" 1017 local metafile="$(emktemp)"
1029 tail -c +$((${metaskip}+1)) ${src} > ${metafile} 1018 tail -c +$((${metaskip}+1)) ${src} > ${metafile}
1030 1019
1031 # rip out the final file name from the metadata 1020 # rip out the final file name from the metadata
1032 local datafile="`tail -c +$((${metaskip}+1)) ${src} | strings | head -n 1`" 1021 local datafile="`tail -c +$((${metaskip}+1)) ${src} | strings | head -n 1`"
1033 datafile="`basename ${datafile}`" 1022 datafile="`basename ${datafile}`"
1034 1023
1035 # now lets uncompress/untar the file if need be 1024 # now lets uncompress/untar the file if need be
1036 local tmpfile="`mymktemp ${T}`" 1025 local tmpfile="$(emktemp)"
1037 tail -c +$((${tailskip}+1)) ${src} 2>/dev/null | head -c 512 > ${tmpfile} 1026 tail -c +$((${tailskip}+1)) ${src} 2>/dev/null | head -c 512 > ${tmpfile}
1038 1027
1039 local iscompressed="`file -b ${tmpfile}`" 1028 local iscompressed="`file -b ${tmpfile}`"
1040 if [ "${iscompressed:0:8}" == "compress" ] ; then 1029 if [ "${iscompressed:0:8}" == "compress" ] ; then
1041 iscompressed=1 1030 iscompressed=1
1143 dd) exe="dd ibs=${skip} skip=1 obs=1024 conv=sync if='${src}'";; 1132 dd) exe="dd ibs=${skip} skip=1 obs=1024 conv=sync if='${src}'";;
1144 *) die "makeself cant handle exe '${exe}'" 1133 *) die "makeself cant handle exe '${exe}'"
1145 esac 1134 esac
1146 1135
1147 # lets grab the first few bytes of the file to figure out what kind of archive it is 1136 # lets grab the first few bytes of the file to figure out what kind of archive it is
1148 local tmpfile="$(mymktemp "${T}")" 1137 local tmpfile="$(emktemp)"
1149 eval ${exe} 2>/dev/null | head -c 512 > "${tmpfile}" 1138 eval ${exe} 2>/dev/null | head -c 512 > "${tmpfile}"
1150 local filetype="$(file -b "${tmpfile}")" 1139 local filetype="$(file -b "${tmpfile}")"
1151 case ${filetype} in 1140 case ${filetype} in
1152 *tar\ archive) 1141 *tar\ archive)
1153 eval ${exe} | tar --no-same-owner -xf - 1142 eval ${exe} | tar --no-same-owner -xf -
1200 return 0 1189 return 0
1201 fi 1190 fi
1202 done 1191 done
1203 set +o noglob; set -$shopts #reset old shell opts 1192 set +o noglob; set -$shopts #reset old shell opts
1204 1193
1205 local licmsg="`mymktemp ${T}`" 1194 local licmsg="$(emktemp)"
1206 cat << EOF > ${licmsg} 1195 cat << EOF > ${licmsg}
1207********************************************************** 1196**********************************************************
1208The following license outlines the terms of use of this 1197The following license outlines the terms of use of this
1209package. You MUST accept this license for installation to 1198package. You MUST accept this license for installation to
1210continue. When you are done viewing, hit 'q'. If you 1199continue. When you are done viewing, hit 'q'. If you
1438 1427
1439 ls=" ${ls} " 1428 ls=" ${ls} "
1440 newls="" 1429 newls=""
1441 for f in ${LINGUAS} ; do 1430 for f in ${LINGUAS} ; do
1442 if [ "${ls/ ${f} /}" != "${ls}" ] ; then 1431 if [ "${ls/ ${f} /}" != "${ls}" ] ; then
1443 nl="${newls} ${f}" 1432 newls="${newls} ${f}"
1444 else 1433 else
1445 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA" 1434 ewarn "Sorry, but ${PN} does not support the ${f} LINGUA"
1446 fi 1435 fi
1447 done 1436 done
1448 if [ -z "${newls}" ] ; then 1437 if [ -z "${newls}" ] ; then
1521 einfo "is not being removed. In order to make full use of this newer version," 1510 einfo "is not being removed. In order to make full use of this newer version,"
1522 einfo "you will need to execute the following command:" 1511 einfo "you will need to execute the following command:"
1523 einfo " revdep-rebuild --soname ${SONAME}" 1512 einfo " revdep-rebuild --soname ${SONAME}"
1524 einfo 1513 einfo
1525 einfo "After doing that, you can safely remove ${LIB}" 1514 einfo "After doing that, you can safely remove ${LIB}"
1515 einfo "Note: 'emerge gentoolkit' to get revdep-rebuild"
1526 fi 1516 fi
1527} 1517}
1518
1519# Hack for people to figure out if a package was built with
1520# certain USE flags
1521#
1522# Usage: built_with_use <DEPEND ATOM> <List of USE flags>
1523# ex: built_with_use xchat gtk2
1524built_with_use() {
1525 local PKG=$(portageq best_version ${ROOT} $1)
1526 local USEFILE="${ROOT}/var/db/pkg/${PKG}/USE"
1527 [[ ! -e ${USEFILE} ]] && return 1
1528
1529 local USE_BUILT=$(<${USEFILE})
1530
1531 shift
1532 while [ $# -gt 0 ] ; do
1533 has $1 ${USE_BUILT} || return 1
1534 shift
1535 done
1536 return 0
1537}
1538
1539# Many configure scripts wrongly bail when a C++ compiler
1540# could not be detected. #73450
1541epunt_cxx() {
1542 EPATCH_SINGLE_MSG="Removing useless C++ checks ..." \
1543 epatch "${PORTDIR}/eclass/ELT-patches/nocxx/nocxx.patch"
1544}

Legend:
Removed from v.1.114  
changed lines
  Added in v.1.126

  ViewVC Help
Powered by ViewVC 1.1.20