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

Diff of /eclass/libtool.eclass

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

Revision 1.102 Revision 1.106
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 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/libtool.eclass,v 1.102 2012/09/15 16:16:53 zmedico Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.106 2013/05/11 11:17:58 aballier Exp $
4 4
5# @ECLASS: libtool.eclass 5# @ECLASS: libtool.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: quickly update bundled libtool code 8# @BLURB: quickly update bundled libtool code
47 __ELT_NOTED_TMP=true 47 __ELT_NOTED_TMP=true
48 printf 'temp patch: %s\n' "${patch}" > "${log}" 48 printf 'temp patch: %s\n' "${patch}" > "${log}"
49 fi 49 fi
50 printf '\nTrying %s\n' "${disp}" >> "${log}" 50 printf '\nTrying %s\n' "${disp}" >> "${log}"
51 51
52 if [[ ! -e ${file} ]] ; then
53 echo "File not found: ${file}" >> "${log}"
54 return 1
55 fi
56
57 # Save file for permission restoration. `patch` sometimes resets things.
58 # Ideally we'd want 'stat -c %a', but stat is highly non portable and we are
59 # guaranted to have GNU find, so use that instead.
60 local perms="$(find ${file} -maxdepth 0 -printf '%m')"
52 # We only support patchlevel of 0 - why worry if its static patches? 61 # We only support patchlevel of 0 - why worry if its static patches?
53 if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then 62 if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then
54 einfo " Applying ${disp} ..." 63 einfo " Applying ${disp} ..."
55 patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" >> "${log}" 2>&1 64 patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" >> "${log}" 2>&1
56 ret=$? 65 ret=$?
57 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${src}" 66 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${src}"
58 else 67 else
59 ret=1 68 ret=1
60 fi 69 fi
70 chmod "${perms}" "${file}"
61 71
62 return "${ret}" 72 return "${ret}"
63} 73}
64 74
65# 75#
130 local do_only_patches="no" 140 local do_only_patches="no"
131 local do_uclibc="yes" 141 local do_uclibc="yes"
132 local deptoremove= 142 local deptoremove=
133 local do_shallow="no" 143 local do_shallow="no"
134 local force="false" 144 local force="false"
135 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed" 145 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed target-nm"
136 146
137 for x in "$@" ; do 147 for x in "$@" ; do
138 case ${x} in 148 case ${x} in
139 --portage) 149 --portage)
140 # Only apply portage patch, and don't 150 # Only apply portage patch, and don't
347 fi 357 fi
348 if [[ $subret -eq 0 ]]; then 358 if [[ $subret -eq 0 ]]; then
349 # have at least one patch succeeded. 359 # have at least one patch succeeded.
350 ret=0 360 ret=0
351 fi 361 fi
362 ;;
363 target-nm)
364 ELT_walk_patches "${d}/configure" "${p}"
365 ret=$?
352 ;; 366 ;;
353 install-sh) 367 install-sh)
354 ELT_walk_patches "${d}/install-sh" "${p}" 368 ELT_walk_patches "${d}/install-sh" "${p}"
355 ret=$? 369 ret=$?
356 ;; 370 ;;

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.106

  ViewVC Help
Powered by ViewVC 1.1.20