From 3ed75855c627e5439967b05110109a8814f1184f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 28 Aug 2010 15:04:01 -0700 Subject: [PATCH] Simplify the empty USE conditional /var/db/pkg metadata code in _post_src_install_uid_fix(), and handle one more case. --- pym/portage/package/ebuild/doebuild.py | 14 ++++++-------- 1 file 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'), -- 2.26.2