[entropy.spm] PortagePlugin: drop FEATURES usage completely

Removing "splitdebug" from FEATURES if splitdebug is disabled is
pointless and not really needed. Better leave FEATURES untouched.
Moreover, pkgcore doesn't provide FEATURES at all.
This commit is contained in:
Fabio Erculiani
2011-12-02 12:03:18 +01:00
parent 104fb3b151
commit 5fa3e58679

View File

@@ -302,7 +302,6 @@ class PortagePlugin(SpmPlugin):
'repository': "repository",
'pf': "PF",
'eapi': "EAPI",
'features': "FEATURES",
}
_xpak_const = {
@@ -2643,20 +2642,6 @@ class PortagePlugin(SpmPlugin):
if hasattr(vartree.dbapi, '_bump_mtime'):
vartree.dbapi._bump_mtime(portage_cpv)
def __splitdebug_update_features_file(self, features_path):
enc = etpConst['conf_encoding']
with codecs.open(features_path, "r", encoding=enc) as feat_f:
feat_content = feat_f.read().split(" ")
if "splitdebug" in feat_content:
feat_content.remove("splitdebug")
entropy.tools.atomic_write(
features_path,
const_convert_to_unicode(" ").join(feat_content) + \
const_convert_to_unicode("\n"),
enc)
def __splitdebug_update_contents_file(self, contents_path, splitdebug_dirs):
if not (os.path.isfile(contents_path) and \
@@ -2894,11 +2879,7 @@ class PortagePlugin(SpmPlugin):
splitdebug = package_metadata.get("splitdebug", False)
splitdebug_dirs = package_metadata.get("splitdebug_dirs", tuple())
if splitdebug:
features_path = os.path.join(copypath,
PortagePlugin.xpak_entries['features'])
self.__splitdebug_update_features_file(features_path)
elif not splitdebug and splitdebug_dirs:
if not splitdebug and splitdebug_dirs:
contents_path = os.path.join(copypath,
PortagePlugin.xpak_entries['contents'])
self.__splitdebug_update_contents_file(contents_path,