Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11632 - in main/branches/prefix: bin pym/_emerge pym/portage pym/portage/dbapi
Date: Sun, 05 Oct 2008 16:46:09
Message-Id: E1KmWkA-0003nn-Mb@stork.gentoo.org
1 Author: grobian
2 Date: 2008-10-05 16:46:05 +0000 (Sun, 05 Oct 2008)
3 New Revision: 11632
4
5 Modified:
6 main/branches/prefix/bin/doins
7 main/branches/prefix/bin/ebuild.sh
8 main/branches/prefix/pym/_emerge/__init__.py
9 main/branches/prefix/pym/portage/__init__.py
10 main/branches/prefix/pym/portage/dbapi/vartree.py
11 Log:
12 Merged from trunk -r11621:11630
13
14 | 11622 | A cpv can be returned from dbapi.match() as an old-style |
15 | zmedico | virtual match even in cases when the package does not |
16 | | actually PROVIDE the virtual. Filter out any such false |
17 | | matches inside depgraph._select_package() and |
18 | | _show_unsatisfied_dep(). Thanks to Ned Ludd <solar@g.o> for |
19 | | reporting this issue which was discovered when attempting to |
20 | | install virtual/libc on uclibc profile. Apparently the |
21 | | uclibc ebuilds need to be fixed to properly set PROVIDE when |
22 | | the metadata cache is generated. |
23
24 | 11623 | Bug #239529 - Fix 'doins' to work with symlinks to |
25 | zmedico | directories, like it did before the changes from bug |
26 | | #210575. |
27
28 | 11624 | Add missing quotes on pushd argument from previous commit. |
29 | zmedico | |
30
31 | 11625 | Redirect pushd and popd output to /dev/null when |
32 | zmedico | appropriate. |
33
34 | 11626 | Fix PreservedLibsRegistry.store() so that it only rewrites |
35 | zmedico | the data file when something has changed. |
36
37 | 11627 | Only update the confmem file when something has changed. |
38 | zmedico | |
39
40 | 11628 | * When ensuring sane $PWD in ebuild.sh, die if the `cd |
41 | zmedico | "$PORTAGE_BUILDDIR"` call fails. * Create $PORTAGE_BUILDDIR |
42 | | for the "fetch" phase too since it might be necessary to |
43 | | call pkg_nofetch. |
44
45 | 11629 | Bug #239529 - When doins is called on a symlink to a |
46 | zmedico | directory, preserve the name of the symlink for the |
47 | | installed directory. This involves temporarily renaming the |
48 | | directory and then renaming it back again. |
49
50 | 11630 | In dyn_clean, cd to $PORTAGE_BUILDDIR/.. before attempting |
51 | zmedico | to remove it since some kernels, such as Solaris, return |
52 | | EINVAL when an attempt is made to remove the current working |
53 | | directory. Thanks to Fabian Groffen <grobian@g.o> for |
54 | | reporting. |
55
56
57 Modified: main/branches/prefix/bin/doins
58 ===================================================================
59 --- main/branches/prefix/bin/doins 2008-10-05 16:38:39 UTC (rev 11631)
60 +++ main/branches/prefix/bin/doins 2008-10-05 16:46:05 UTC (rev 11632)
61 @@ -25,6 +25,9 @@
62 exit 1
63 fi
64
65 +TMP=$T/.doins_tmp
66 +mkdir "$TMP"
67 +
68 if [[ ${INSDESTTREE#${EPREFIX}} != "${INSDESTTREE}" ]]; then
69 vecho "-------------------------------------------------------" 1>&2
70 vecho "You should not use \${EPREFIX} with helpers." 1>&2
71 @@ -39,8 +42,8 @@
72 local mysrc="$1" mydir="$2" cleanup="" rval
73
74 if [ -L "$mysrc" ] ; then
75 - cp "$mysrc" "${T}"
76 - mysrc="${T}/${mysrc##*/}"
77 + cp "$mysrc" "$TMP"
78 + mysrc="$TMP/${mysrc##*/}"
79 cleanup=${mysrc}
80 fi
81
82 @@ -72,13 +75,30 @@
83 else
84 pushd "${x%/*}" >/dev/null
85 fi
86 - find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \;
87 - find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins
88 - popd >/dev/null
89 + x=${x##*/}
90 + x_orig=$x
91 + # Follow any symlinks recursively until we've got
92 + # a normal directory for 'find' to traverse.
93 + while [ -L "$x" ] ; do
94 + pushd "$(readlink "$x")" >/dev/null
95 + x=${PWD##*/}
96 + pushd "${PWD%/*}" >/dev/null
97 + done
98 + if [[ $x != $x_orig ]] ; then
99 + mv "$x" "$TMP/$x_orig"
100 + pushd "$TMP" >/dev/null
101 + fi
102 + find "$x_orig" -type d -exec dodir "${INSDESTTREE}/{}" \;
103 + find "$x_orig" \( -type f -or -type l \) -print0 | _xdoins
104 + if [[ $x != $x_orig ]] ; then
105 + popd >/dev/null
106 + mv "$TMP/$x_orig" "$x"
107 + fi
108 + while popd >/dev/null 2>&1 ; do true ; done
109 ((++success))
110 else
111 _doins "${x}" && ((++success))
112 fi
113 done
114 -
115 +rm -rf "$TMP"
116 [ $success -gt 0 ] && exit 0 || exit 1
117
118 Modified: main/branches/prefix/bin/ebuild.sh
119 ===================================================================
120 --- main/branches/prefix/bin/ebuild.sh 2008-10-05 16:38:39 UTC (rev 11631)
121 +++ main/branches/prefix/bin/ebuild.sh 2008-10-05 16:46:05 UTC (rev 11632)
122 @@ -273,7 +273,10 @@
123 }
124
125 # Ensure that $PWD is sane whenever possible.
126 -cd "$PORTAGE_BUILDDIR" 2>/dev/null
127 +if ! hasq "$EBUILD_PHASE" clean depend help ; then
128 + cd "$PORTAGE_BUILDDIR" || \
129 + die "PORTAGE_BUILDDIR does not exist: '$PORTAGE_BUILDDIR'"
130 +fi
131
132 #if no perms are specified, dirs/files will have decent defaults
133 #(not secretive, but not stupid)
134 @@ -757,9 +760,10 @@
135 # result in it wiping the users distfiles directory (bad).
136 rm -rf "${PORTAGE_BUILDDIR}/distdir"
137
138 - if [ -z "$(find "${PORTAGE_BUILDDIR}" -mindepth 1 -maxdepth 1)" ]; then
139 - rmdir "${PORTAGE_BUILDDIR}"
140 - fi
141 + # Some kernels, such as Solaris, return EINVAL when an attempt
142 + # is made to remove the current working directory.
143 + cd "$PORTAGE_BUILDDIR"/..
144 + rmdir "$PORTAGE_BUILDDIR" 2>/dev/null
145
146 true
147 }
148
149 Modified: main/branches/prefix/pym/_emerge/__init__.py
150 ===================================================================
151 --- main/branches/prefix/pym/_emerge/__init__.py 2008-10-05 16:38:39 UTC (rev 11631)
152 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-10-05 16:46:05 UTC (rev 11632)
153 @@ -5220,6 +5220,7 @@
154
155 def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None):
156 atom = portage.dep.Atom(atom)
157 + atom_set = InternalPackageSet(initial_atoms=(atom,))
158 atom_without_use = atom
159 if atom.use:
160 atom_without_use = portage.dep.remove_slot(atom)
161 @@ -5257,13 +5258,22 @@
162 for cpv in cpv_list:
163 metadata, mreasons = get_mask_info(root_config, cpv,
164 pkgsettings, db, pkg_type, built, installed, db_keys)
165 - if atom.use and not mreasons:
166 - missing_use.append(Package(built=built, cpv=cpv,
167 + if metadata is not None:
168 + pkg = Package(built=built, cpv=cpv,
169 installed=installed, metadata=metadata,
170 - root_config=root_config))
171 - else:
172 - masked_packages.append(
173 - (root_config, pkgsettings, cpv, metadata, mreasons))
174 + root_config=root_config)
175 + if pkg.cp != atom.cp:
176 + # A cpv can be returned from dbapi.match() as an
177 + # old-style virtual match even in cases when the
178 + # package does not actually PROVIDE the virtual.
179 + # Filter out any such false matches here.
180 + if not atom_set.findAtomForPackage(pkg):
181 + continue
182 + if atom.use and not mreasons:
183 + missing_use.append(pkg)
184 + continue
185 + masked_packages.append(
186 + (root_config, pkgsettings, cpv, metadata, mreasons))
187
188 missing_use_reasons = []
189 missing_iuse_reasons = []
190 @@ -5357,6 +5367,7 @@
191 if not isinstance(atom, portage.dep.Atom):
192 atom = portage.dep.Atom(atom)
193 atom_cp = atom.cp
194 + atom_set = InternalPackageSet(initial_atoms=(atom,))
195 existing_node = None
196 myeb = None
197 usepkgonly = "--usepkgonly" in self.myopts
198 @@ -5504,6 +5515,14 @@
199 pkgsettings.setcpv(pkg)
200 pkg.metadata["USE"] = pkgsettings["PORTAGE_USE"]
201
202 + if pkg.cp != atom.cp:
203 + # A cpv can be returned from dbapi.match() as an
204 + # old-style virtual match even in cases when the
205 + # package does not actually PROVIDE the virtual.
206 + # Filter out any such false matches here.
207 + if not atom_set.findAtomForPackage(pkg):
208 + continue
209 +
210 myarg = None
211 if root == self.target_root:
212 try:
213
214 Modified: main/branches/prefix/pym/portage/__init__.py
215 ===================================================================
216 --- main/branches/prefix/pym/portage/__init__.py 2008-10-05 16:38:39 UTC (rev 11631)
217 +++ main/branches/prefix/pym/portage/__init__.py 2008-10-05 16:46:05 UTC (rev 11632)
218 @@ -5478,8 +5478,7 @@
219
220 # Build directory creation isn't required for any of these.
221 have_build_dirs = False
222 - if mydo not in ("clean", "cleanrm", "digest",
223 - "fetch", "help", "manifest"):
224 + if mydo not in ("digest", "help", "manifest"):
225 mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
226 if mystatus:
227 return mystatus
228
229 Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
230 ===================================================================
231 --- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-10-05 16:38:39 UTC (rev 11631)
232 +++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-10-05 16:46:05 UTC (rev 11632)
233 @@ -65,12 +65,13 @@
234 raise PermissionDenied(self._filename)
235 else:
236 raise e
237 -
238 + self._data_orig = self._data.copy()
239 def store(self):
240 """ Store the registry data to file. No need to call this if autocommit
241 was enabled.
242 """
243 - if os.environ.get("SANDBOX_ON") == "1":
244 + if os.environ.get("SANDBOX_ON") == "1" or \
245 + self._data == self._data_orig:
246 return
247 try:
248 f = atomic_ofstream(self._filename)
249 @@ -3495,6 +3496,7 @@
250 #if we have a file containing previously-merged config file md5sums, grab it.
251 conf_mem_file = os.path.join(destroot, EPREFIX_LSTRIP, CONFIG_MEMORY_FILE)
252 cfgfiledict = grabdict(conf_mem_file)
253 + cfgfiledict_orig = cfgfiledict.copy()
254 if "NOCONFMEM" in self.settings:
255 cfgfiledict["IGNORE"]=1
256 else:
257 @@ -3555,9 +3557,10 @@
258
259 # write out our collection of md5sums
260 cfgfiledict.pop("IGNORE", None)
261 - ensure_dirs(os.path.dirname(conf_mem_file),
262 - gid=portage_gid, mode=02750, mask=02)
263 - writedict(cfgfiledict, conf_mem_file)
264 + if cfgfiledict != cfgfiledict_orig:
265 + ensure_dirs(os.path.dirname(conf_mem_file),
266 + gid=portage_gid, mode=02750, mask=02)
267 + writedict(cfgfiledict, conf_mem_file)
268
269 # These caches are populated during collision-protect and the data
270 # they contain is now invalid. It's very important to invalidate