When evaluating USE conditional metadata for /var/db/pkg inside
authorZac Medico <zmedico@gentoo.org>
Sat, 28 Aug 2010 21:44:42 +0000 (14:44 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 28 Aug 2010 21:44:42 +0000 (14:44 -0700)
_post_src_install_uid_fix(), ensure non-empty entries are removed
if the evaluation results in an empty value.

pym/portage/package/ebuild/doebuild.py

index 71b55be2998c25b93bef2edcd23535bd076fc515..e26509a0537aa0764ddd2a0a69fc33b0383c1b2d 100644 (file)
@@ -1472,6 +1472,17 @@ def _post_src_install_uid_fix(mysettings, out):
                v = use_reduce(v, uselist=use, token_class=token_class)
                v = paren_enclose(v)
                if not v:
+                       filename = os.path.join(build_info_dir, k)
+                       try:
+                               st = os.stat(filename)
+                       except OSError:
+                               pass
+                       else:
+                               if st.st_size != 0:
+                                       try:
+                                               os.unlink(filename)
+                                       except OSError:
+                                               pass
                        continue
                codecs.open(_unicode_encode(os.path.join(build_info_dir,
                        k), encoding=_encodings['fs'], errors='strict'),