summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-28 15:04:01 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-28 15:04:01 -0700
commit3ed75855c627e5439967b05110109a8814f1184f (patch)
tree1f4a09c6ad5b42d75c2af075c004d5d251447e9e
parent126fe9a6de1493f0dfcd0707cf6e36d3620026d5 (diff)
downloadportage-3ed75855c627e5439967b05110109a8814f1184f.tar.gz
portage-3ed75855c627e5439967b05110109a8814f1184f.tar.bz2
portage-3ed75855c627e5439967b05110109a8814f1184f.zip
Simplify the empty USE conditional /var/db/pkg metadata code in
_post_src_install_uid_fix(), and handle one more case.
-rw-r--r--pym/portage/package/ebuild/doebuild.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index e26509a05..9fa6476e0 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1461,7 +1461,12 @@ def _post_src_install_uid_fix(mysettings, out):
use = frozenset(mysettings['PORTAGE_USE'].split())
for k in _vdb_use_conditional_keys:
v = mysettings.configdict['pkg'].get(k)
+ filename = os.path.join(build_info_dir, k)
if v is None:
+ try:
+ os.unlink(filename)
+ except OSError:
+ pass
continue
if k.endswith('DEPEND'):
@@ -1472,17 +1477,10 @@ 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)
+ os.unlink(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'),