Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13394 - in main/branches/prefix: bin pym/portage
Date: Sat, 25 Apr 2009 08:38:54
Message-Id: E1LxdPQ-0000IJ-8C@stork.gentoo.org
1 Author: grobian
2 Date: 2009-04-25 08:38:51 +0000 (Sat, 25 Apr 2009)
3 New Revision: 13394
4
5 Modified:
6 main/branches/prefix/bin/ebuild.sh
7 main/branches/prefix/pym/portage/__init__.py
8 Log:
9 Merged from trunk -r13383:13387
10
11 | 13384 | Use declare -F to check existence of function definitions, |
12 | zmedico | instead of type -t, in order to avoid use of subshells. |
13
14 | 13385 | Remove ccache and distcc remove_path_entry code since PATH |
15 | zmedico | is always initialized from scratch so there's no danger of |
16 | | accumulation. |
17
18 | 13386 | Fix breakage in PREROOTPATH logic from the EAPI 3 code. |
19 | zmedico | |
20
21 | 13387 | Automatically define errno.ESTALE if it doesn't exist (like |
22 | zmedico | on interix). Thanks to Markus Duft <mduft@g.o> for |
23 | | reporting. |
24
25
26 Modified: main/branches/prefix/bin/ebuild.sh
27 ===================================================================
28 --- main/branches/prefix/bin/ebuild.sh 2009-04-25 08:37:23 UTC (rev 13393)
29 +++ main/branches/prefix/bin/ebuild.sh 2009-04-25 08:38:51 UTC (rev 13394)
30 @@ -638,7 +638,7 @@
31 }
32
33 ebuild_phase() {
34 - [ "$(type -t ${1})" == "function" ] && qa_call ${1}
35 + declare -F "$1" >/dev/null && qa_call $1
36 }
37
38 ebuild_phase_with_hooks() {
39 @@ -1271,7 +1271,7 @@
40 if [[ -n ${!__export_funcs_var} ]] ; then
41 for x in ${!__export_funcs_var} ; do
42 debug-print "EXPORT_FUNCTIONS: $x -> ${ECLASS}_$x"
43 - [[ $(type -t ${ECLASS}_$x) = function ]] || \
44 + declare -F "${ECLASS}_$x" >/dev/null || \
45 die "EXPORT_FUNCTIONS: ${ECLASS}_$x is not defined"
46 eval "$x() { ${ECLASS}_$x \"\$@\" ; }" > /dev/null
47 done
48 @@ -1450,7 +1450,7 @@
49 local x y default_func=""
50
51 for x in pkg_nofetch src_unpack src_test ; do
52 - [[ $(type -t $x) = function ]] || \
53 + declare -F $x >/dev/null || \
54 eval "$x() { _eapi0_$x \"\$@\" ; }"
55 done
56
57 @@ -1458,7 +1458,7 @@
58
59 0|1)
60
61 - if [[ $(type -t src_compile) != function ]] ; then
62 + if ! declare -F src_compile >/dev/null ; then
63 case $eapi in
64 0)
65 src_compile() { _eapi0_src_compile "$@" ; }
66 @@ -1483,10 +1483,10 @@
67
68 *)
69
70 - [[ $(type -t src_configure) = function ]] || \
71 + declare -F src_configure >/dev/null || \
72 src_configure() { _eapi2_src_configure "$@" ; }
73
74 - [[ $(type -t src_compile) = function ]] || \
75 + declare -F src_compile >/dev/null || \
76 src_compile() { _eapi2_src_compile "$@" ; }
77
78 if hasq $phase_func $default_phases ; then
79 @@ -1848,7 +1848,7 @@
80 [[ -n $EAPI ]] || EAPI=0
81
82 # alphabetically ordered by $EBUILD_PHASE value
83 - local valid_phases
84 + local f valid_phases
85 case "$EAPI" in
86 0|1)
87 valid_phases="src_compile pkg_config pkg_info src_install
88 @@ -1864,7 +1864,7 @@
89
90 DEFINED_PHASES=
91 for f in $valid_phases ; do
92 - if [[ $(type -t $f) = function ]] ; then
93 + if declare -F $f >/dev/null ; then
94 f=${f#pkg_}
95 DEFINED_PHASES+=" ${f#src_}"
96 fi
97 @@ -1924,19 +1924,17 @@
98 esac
99
100 export PATH="/usr/local/sbin:/sbin:/usr/sbin:${ebuild_helpers_path}:/usr/local/bin:/bin:/usr/bin:${ROOTPATH}"
101 + [[ -n $PREROOTPATH ]] && export PATH="${PREROOTPATH%%:}:$PATH"
102 unset ebuild_helpers_path
103
104 if ! hasq $EBUILD_SH_ARGS clean depend help info nofetch ; then
105
106 if hasq distcc $FEATURES ; then
107 - [[ -z ${PATH/*distcc*/} ]] && remove_path_entry distcc
108 export PATH="${EPREFIX}/usr/lib/distcc/bin:$PATH"
109 [[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
110 fi
111
112 if hasq ccache $FEATURES ; then
113 - [[ -z ${PATH/*ccache*/} ]] && remove_path_entry ccache
114 -
115 export PATH="${EPREFIX}/usr/lib/ccache/bin:$PATH"
116
117 addread "$CCACHE_DIR"
118 @@ -1964,8 +1962,8 @@
119 exit 1
120 ;;
121 prerm|postrm|postinst|config|info)
122 - if hasq ${EBUILD_SH_ARGS} config info && \
123 - [ "$(type -t pkg_${EBUILD_SH_ARGS})" != "function" ]; then
124 + if hasq "$EBUILD_SH_ARGS" config info && \
125 + ! declare -F "pkg_$EBUILD_SH_ARGS" >/dev/null ; then
126 ewarn "pkg_${EBUILD_SH_ARGS}() is not defined: '${EBUILD##*/}'"
127 fi
128 export SANDBOX_ON="0"
129
130 Modified: main/branches/prefix/pym/portage/__init__.py
131 ===================================================================
132 --- main/branches/prefix/pym/portage/__init__.py 2009-04-25 08:37:23 UTC (rev 13393)
133 +++ main/branches/prefix/pym/portage/__init__.py 2009-04-25 08:38:51 UTC (rev 13394)
134 @@ -15,6 +15,9 @@
135 import codecs
136 import copy
137 import errno
138 + if not hasattr(errno, 'ESTALE'):
139 + # ESTALE may not be defined on some systems, such as interix.
140 + errno.ESTALE = -1
141 import logging
142 import os
143 import re