return myaction, myopts, myfiles
def validate_ebuild_environment(trees):
- for myroot in trees:
- mysettings = trees[myroot]["vartree"].settings
- for var in "ARCH", "USERLAND":
- if mysettings.get(var):
- continue
- print >> sys.stderr, bad(("\a!!! %s is not set... " % var) + \
- "Are you missing the '%setc/make.profile' symlink?" % \
- mysettings["PORTAGE_CONFIGROOT"])
- print >> sys.stderr, bad("\a!!! Is the symlink correct? " + \
- "Is your portage tree complete?\n")
- sys.exit(9)
- del myroot, mysettings
+ pass
def load_emerge_config(trees=None):
kwargs = {}
env_stat = None
if env_stat:
mysettings._filter_calling_env = True
+ else:
+ for var in "ARCH", "USERLAND":
+ if mysettings.get(var):
+ continue
+ msg = ("%s is not set... " % var) + \
+ ("Are you missing the '%setc/make.profile' symlink? " % \
+ mysettings["PORTAGE_CONFIGROOT"]) + \
+ "Is the symlink correct? " + \
+ "Is your portage tree complete?"
+ from portage.elog.messages import eerror
+ from textwrap import wrap
+ for line in wrap(msg, 70):
+ eerror(line, phase=mydo, key=mysettings.mycpv)
+ from portage.elog import elog_process
+ elog_process(mysettings.mycpv, mysettings)
+ return 1
del env_file, env_stat, saved_env
_doebuild_exit_status_unlink(
mysettings.get("EBUILD_EXIT_STATUS_FILE"))
self.eclassdb = eclass_cache.cache(self.porttree_root,
overlays=self.mysettings["PORTDIR_OVERLAY"].split())
+ # This is used as sanity check for aux_get(). If there is no
+ # root eclass dir, we assume that PORTDIR is invalid or
+ # missing. This check allows aux_get() to detect a missing
+ # portage tree and return early by raising a KeyError.
+ self._have_root_eclass_dir = os.path.isdir(
+ os.path.join(self.porttree_root, "eclasses"))
+
self.metadbmodule = self.mysettings.load_best_module("portdbapi.metadbmodule")
#if the portdbapi is "frozen", then we assume that we can cache everything (that no updates to it are happening)
if doregen:
if myebuild in self._broken_ebuilds:
raise KeyError(mycpv)
+ if not self._have_root_eclass_dir:
+ raise KeyError(mycpv)
writemsg("doregen: %s %s\n" % (doregen, mycpv), 2)
writemsg("Generating cache entry(0) for: "+str(myebuild)+"\n", 1)
portdir = portdb.porttree_root
profiles_base = os.path.join(portdir, 'profiles') + os.path.sep
- profile_path = normalize_path(
- os.path.realpath(portdb.mysettings.profile_path))
- if profile_path.startswith(profiles_base):
- profile_path = profile_path[len(profiles_base):]
+ profile_path = None
+ if portdb.mysettings.profile_path:
+ profile_path = normalize_path(
+ os.path.realpath(portdb.mysettings.profile_path))
+ if profile_path.startswith(profiles_base):
+ profile_path = profile_path[len(profiles_base):]
self._profile_path = profile_path
# Ensure that the unread path exists and is writable.