import tempfile
import portage
from portage import os
-from portage.const import PORTAGE_BASE_PATH
+from portage.const import GLOBAL_CONFIG_PATH, PORTAGE_BASE_PATH
from portage.dbapi.vartree import vartree
from portage.dbapi.porttree import portagetree
from portage.dbapi.bintree import binarytree
from portage.package.ebuild.digestgen import digestgen
from portage._sets import load_default_config
from portage._sets.base import InternalPackageSet
+from portage.util import ensure_dirs
from portage.versions import catsplit
import _emerge
f.close()
write_key("EAPI", eapi)
+ write_key("COUNTER", "0")
write_key("LICENSE", lic)
write_key("PROPERTIES", properties)
write_key("SLOT", slot)
f.write("x86\n")
f.close()
+ parent_file = os.path.join(sub_profile_dir, "parent")
+ f = open(parent_file, "w")
+ f.write("..\n")
+ f.close()
+
if profile:
for config_file, lines in profile.items():
if config_file not in self.config_files:
f.write("%s\n" % line)
f.close()
+ #Create /usr/share/portage/config/make.globals
+ make_globals_path = os.path.join(self.eroot,
+ GLOBAL_CONFIG_PATH.lstrip(os.sep), "make.globals")
+ ensure_dirs(os.path.dirname(make_globals_path))
+ os.symlink(os.path.join(PORTAGE_BASE_PATH, "cnf", "make.globals"),
+ make_globals_path)
+
#Create /usr/share/portage/config/sets/portage.conf
default_sets_conf_dir = os.path.join(self.eroot, "usr/share/portage/config/sets")