1 |
Author: grobian |
2 |
Date: 2008-02-06 22:26:20 +0000 (Wed, 06 Feb 2008) |
3 |
New Revision: 9280 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/ebuild.sh |
7 |
main/branches/prefix/bin/misc-functions.sh |
8 |
main/branches/prefix/pym/_emerge/__init__.py |
9 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
10 |
main/branches/prefix/pym/portage/util.py |
11 |
Log: |
12 |
Merged from trunk 9274:9279 |
13 |
|
14 |
| 9275 | don't record internal providers in NEEDED records as they | |
15 |
| genone | are pointless for all useful applications in portage and | |
16 |
| | complicate them instead (e.g. bug #205531) | |
17 |
|
18 |
| 9276 | display errors that occured during package set initalization | |
19 |
| genone | | |
20 |
|
21 |
| 9277 | don't try to copy manually removed libraries (bug #208946) | |
22 |
| genone | | |
23 |
|
24 |
| 9278 | Make qa_source and qa_call save the return value and return | |
25 |
| zmedico | it. Thanks to igli for suggesting. | |
26 |
|
27 |
| 9279 | For the useq() IUSE qa check, use [[ $u =~ $PORTAGE_IUSE ]] | |
28 |
| zmedico | instead of egrep since apparently it's compatible in this | |
29 |
| | case. Thanks to igli for this. | |
30 |
|
31 |
|
32 |
Modified: main/branches/prefix/bin/ebuild.sh |
33 |
=================================================================== |
34 |
--- main/branches/prefix/bin/ebuild.sh 2008-02-06 08:43:57 UTC (rev 9279) |
35 |
+++ main/branches/prefix/bin/ebuild.sh 2008-02-06 22:26:20 UTC (rev 9280) |
36 |
@@ -33,22 +33,26 @@ |
37 |
|
38 |
qa_source() { |
39 |
local shopts=$(shopt) OLDIFS="$IFS" |
40 |
- source "$@" || return 1 |
41 |
+ local retval |
42 |
+ source "$@" |
43 |
+ retval=$? |
44 |
[[ $shopts != $(shopt) ]] && |
45 |
eqawarn "QA Notice: Global shell options changed and were not restored while sourcing '$*'" |
46 |
[[ "$IFS" != "$OLDIFS" ]] && |
47 |
eqawarn "QA Notice: Global IFS changed and was not restored while sourcing '$*'" |
48 |
- return 0 |
49 |
+ return $retval |
50 |
} |
51 |
|
52 |
qa_call() { |
53 |
local shopts=$(shopt) OLDIFS="$IFS" |
54 |
- "$@" || return 1 |
55 |
+ local retval |
56 |
+ "$@" |
57 |
+ retval=$? |
58 |
[[ $shopts != $(shopt) ]] && |
59 |
eqawarn "QA Notice: Global shell options changed and were not restored while calling '$*'" |
60 |
[[ "$IFS" != "$OLDIFS" ]] && |
61 |
eqawarn "QA Notice: Global IFS changed and was not restored while calling '$*'" |
62 |
- return 0 |
63 |
+ return $retval |
64 |
} |
65 |
|
66 |
# subshell die support |
67 |
@@ -144,7 +148,7 @@ |
68 |
[[ ${EMERGE_FROM} != binary ]] ; then |
69 |
# TODO: Implement PORTAGE_IUSE for binary packages. Currently, |
70 |
# it is only valid for build time phases. |
71 |
- echo "${u}" | egrep -q "${PORTAGE_IUSE}" || \ |
72 |
+ [[ $u =~ $PORTAGE_IUSE ]] || \ |
73 |
eqawarn "QA Notice: USE Flag '${u}' not" \ |
74 |
"in IUSE for ${CATEGORY}/${PF}" |
75 |
fi |
76 |
|
77 |
Modified: main/branches/prefix/bin/misc-functions.sh |
78 |
=================================================================== |
79 |
--- main/branches/prefix/bin/misc-functions.sh 2008-02-06 08:43:57 UTC (rev 9279) |
80 |
+++ main/branches/prefix/bin/misc-functions.sh 2008-02-06 22:26:20 UTC (rev 9280) |
81 |
@@ -159,8 +159,27 @@ |
82 |
sleep 1 |
83 |
fi |
84 |
|
85 |
- # Save NEEDED information |
86 |
- scanelf -qyRF '%p %n' "${D}" | sed -e 's:^:/:' > "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
87 |
+ # Save NEEDED information after removing self-contained providers |
88 |
+ scanelf -qyRF '%p:%r %n' "${D}" | sed -e 's:^:/:' | { while read l; do |
89 |
+ obj=${l%%:*} |
90 |
+ rpath=${l##*:}; rpath=${rpath%% *} |
91 |
+ needed=${l##* } |
92 |
+ if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then |
93 |
+ # object doesn't contain $ORIGIN in its runpath attribute |
94 |
+ echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
95 |
+ else |
96 |
+ dir=$(dirname ${obj}) |
97 |
+ # replace $ORIGIN with the dirname of the current object for the lookup |
98 |
+ opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#") |
99 |
+ sneeded=$(echo ${needed} | tr , ' ') |
100 |
+ rneeded="" |
101 |
+ for lib in ${sneeded}; do |
102 |
+ [ -e "${D}/${dir}/${lib}" ] || rneeded="${rneeded},${lib}" |
103 |
+ done |
104 |
+ rneeded=${rneeded:1} |
105 |
+ [ -n "${rneeded}" ] && echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
106 |
+ fi |
107 |
+ done } |
108 |
|
109 |
if [[ ${insecure_rpath} -eq 1 ]] ; then |
110 |
die "Aborting due to serious QA concerns with RUNPATH/RPATH" |
111 |
|
112 |
Modified: main/branches/prefix/pym/_emerge/__init__.py |
113 |
=================================================================== |
114 |
--- main/branches/prefix/pym/_emerge/__init__.py 2008-02-06 08:43:57 UTC (rev 9279) |
115 |
+++ main/branches/prefix/pym/_emerge/__init__.py 2008-02-06 22:26:20 UTC (rev 9280) |
116 |
@@ -7144,6 +7144,10 @@ |
117 |
if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge", None): |
118 |
root_config = trees[settings["ROOT"]]["root_config"] |
119 |
setconfig = root_config.setconfig |
120 |
+ # display errors that occured while loading the SetConfig instance |
121 |
+ for e in setconfig.errors: |
122 |
+ print colorize("BAD", "Error during set creation: %s" % e) |
123 |
+ |
124 |
sets = setconfig.getSets() |
125 |
# emerge relies on the existance of sets with names "world" and "system" |
126 |
required_sets = ("world", "system") |
127 |
|
128 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
129 |
=================================================================== |
130 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-02-06 08:43:57 UTC (rev 9279) |
131 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-02-06 22:26:20 UTC (rev 9280) |
132 |
@@ -1594,11 +1594,16 @@ |
133 |
# get the real paths for the libs |
134 |
preserve_paths = [x for x in old_contents if os.path.basename(x) in preserve_libs] |
135 |
del old_contents, old_libs, mylibs, preserve_libs |
136 |
- |
137 |
+ |
138 |
# inject files that should be preserved into our image dir |
139 |
import shutil |
140 |
+ missing_paths = [] |
141 |
for x in preserve_paths: |
142 |
print "injecting %s into %s" % (x, srcroot) |
143 |
+ if not os.path.exists(os.path.join(destroot, x.lstrip(os.sep))): |
144 |
+ print "%s does not exist so can't be preserved" |
145 |
+ missing_paths.append(x) |
146 |
+ continue |
147 |
mydir = os.path.join(srcroot, os.path.dirname(x).lstrip(os.sep)) |
148 |
if not os.path.exists(mydir): |
149 |
os.makedirs(mydir) |
150 |
@@ -1616,6 +1621,10 @@ |
151 |
shutil.copy2(os.path.join(destroot, x.lstrip(os.sep)), |
152 |
os.path.join(srcroot, x.lstrip(os.sep))) |
153 |
|
154 |
+ preserve_paths = [x for x in preserve_paths if x not in missing_paths] |
155 |
+ |
156 |
+ del missing_paths |
157 |
+ |
158 |
# keep track of the libs we preserved |
159 |
self.vartree.dbapi.plib_registry.register(self.mycpv, self.settings["SLOT"], counter, preserve_paths) |
160 |
|
161 |
|
162 |
Modified: main/branches/prefix/pym/portage/util.py |
163 |
=================================================================== |
164 |
--- main/branches/prefix/pym/portage/util.py 2008-02-06 08:43:57 UTC (rev 9279) |
165 |
+++ main/branches/prefix/pym/portage/util.py 2008-02-06 22:26:20 UTC (rev 9280) |
166 |
@@ -1059,3 +1059,21 @@ |
167 |
os.path.join(real_dirname, last_pfile)) == newmd5: |
168 |
return old_pfile |
169 |
return new_pfile |
170 |
+ |
171 |
+def getlibpaths(): |
172 |
+ """ Return a list of paths that are used for library lookups """ |
173 |
+ |
174 |
+ # PREFIX HIJACK: if this function is used (it seems to be just added |
175 |
+ # nothing more, then let us know, because then we need to fix this... |
176 |
+ raise "This is not prefix-proof, and certainly not x-platform proof!" |
177 |
+ |
178 |
+ # the following is based on the information from ld.so(8) |
179 |
+ rval = os.environ.get("LD_LIBRARY_PATH", "").split(":") |
180 |
+ rval.extend(grabfile("/etc/ld.so.conf")) |
181 |
+ rval.append("/usr/lib") |
182 |
+ rval.append("/lib") |
183 |
+ |
184 |
+ rval = [normalize_path(x) for x in rval if x != ""] |
185 |
+ |
186 |
+ return rval |
187 |
+ |
188 |
|
189 |
-- |
190 |
gentoo-commits@l.g.o mailing list |