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

Diff of /eclass/eutils.eclass

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

Revision 1.405 Revision 1.407
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.405 2012/09/28 15:18:04 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.407 2012/10/11 16:50:53 mgorny Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
549 549
550# @FUNCTION: epatch_user 550# @FUNCTION: epatch_user
551# @USAGE: 551# @USAGE:
552# @DESCRIPTION: 552# @DESCRIPTION:
553# Applies user-provided patches to the source tree. The patches are 553# Applies user-provided patches to the source tree. The patches are
554# taken from /etc/portage/patches/<CATEGORY>/<PF|P|PN>/, where the first 554# taken from /etc/portage/patches/<CATEGORY>/<PF|P|PN>[:SLOT]/, where the first
555# of these three directories to exist will be the one to use, ignoring 555# of these three directories to exist will be the one to use, ignoring
556# any more general directories which might exist as well. They must end 556# any more general directories which might exist as well. They must end
557# in ".patch" to be applied. 557# in ".patch" to be applied.
558# 558#
559# User patches are intended for quick testing of patches without ebuild 559# User patches are intended for quick testing of patches without ebuild
581 local applied="${T}/epatch_user.log" 581 local applied="${T}/epatch_user.log"
582 [[ -e ${applied} ]] && return 2 582 [[ -e ${applied} ]] && return 2
583 583
584 # don't clobber any EPATCH vars that the parent might want 584 # don't clobber any EPATCH vars that the parent might want
585 local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches 585 local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
586 for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}; do 586 for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT}}; do
587 EPATCH_SOURCE=${base}/${CTARGET}/${check} 587 EPATCH_SOURCE=${base}/${CTARGET}/${check}
588 [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check} 588 [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check}
589 [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check} 589 [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check}
590 if [[ -d ${EPATCH_SOURCE} ]] ; then 590 if [[ -d ${EPATCH_SOURCE} ]] ; then
591 EPATCH_SOURCE=${EPATCH_SOURCE} \ 591 EPATCH_SOURCE=${EPATCH_SOURCE} \
1412 die "Invalid argument to ${FUNCNAME}(): ${opt}" 1412 die "Invalid argument to ${FUNCNAME}(): ${opt}"
1413 esac 1413 esac
1414 done 1414 done
1415 1415
1416 local f 1416 local f
1417 local queue=()
1417 while IFS= read -r -d '' f; do # for all .la files 1418 while IFS= read -r -d '' f; do # for all .la files
1418 local archivefile=${f/%.la/.a} 1419 local archivefile=${f/%.la/.a}
1419 1420
1420 [[ ${f} != ${archivefile} ]] || die 'regex sanity check failed' 1421 [[ ${f} != ${archivefile} ]] || die 'regex sanity check failed'
1421 1422
1422 # Remove static libs we're not supposed to link against. 1423 # Remove static libs we're not supposed to link against.
1423 if grep -q '^shouldnotlink=yes$' "${f}"; then 1424 if grep -q '^shouldnotlink=yes$' "${f}"; then
1424 if [[ -f ${archivefile} ]]; then 1425 if [[ -f ${archivefile} ]]; then
1425 einfo "Removing unnecessary ${archivefile#${D%/}} (static plugin)" 1426 einfo "Removing unnecessary ${archivefile#${D%/}} (static plugin)"
1426 rm -f "${archivefile}" 1427 queue+=( "${archivefile}" )
1427 fi 1428 fi
1428 1429
1429 # The .la file may be used by a module loader, so avoid removing it 1430 # The .la file may be used by a module loader, so avoid removing it
1430 # unless explicitly requested. 1431 # unless explicitly requested.
1431 [[ ${removing_all} ]] || continue 1432 [[ ${removing_all} ]] || continue
1472 has "${f##*/}" "${pc_libs[@]}" && reason='covered by .pc' 1473 has "${f##*/}" "${pc_libs[@]}" && reason='covered by .pc'
1473 fi 1474 fi
1474 1475
1475 if [[ ${reason} ]]; then 1476 if [[ ${reason} ]]; then
1476 einfo "Removing unnecessary ${f#${D%/}} (${reason})" 1477 einfo "Removing unnecessary ${f#${D%/}} (${reason})"
1477 rm -f "${f}" 1478 queue+=( "${f}" )
1478 fi 1479 fi
1479 done < <(find "${D}" -type f -name '*.la' -print0) 1480 done < <(find "${D}" -xtype f -name '*.la' -print0)
1481
1482 if [[ ${queue[@]} ]]; then
1483 rm -f "${queue[@]}"
1484 fi
1480} 1485}
1481 1486
1482check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; } 1487check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; }
1483 1488
1484fi 1489fi

Legend:
Removed from v.1.405  
changed lines
  Added in v.1.407

  ViewVC Help
Powered by ViewVC 1.1.20