except OSError:
pass
+def _eerror(settings, lines):
+ if not lines:
+ return
+ cmd = "source '%s/isolated-functions.sh' ; " % PORTAGE_BIN_PATH
+ for line in lines:
+ for letter in "\\\"$`":
+ if letter in line:
+ line = line.replace(letter, "\\" + letter)
+ cmd += "eerror \"%s\" ; " % line
+ portage_exec.spawn(["bash", "-c", cmd],
+ env=settings.environ())
+
#parse /etc/env.d and generate /etc/profile.env
def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None,
if msg:
phase_retval = 1
from textwrap import wrap
- cmd = "source '%s/isolated-functions.sh' ; " % \
- PORTAGE_BIN_PATH
- for l in wrap(msg, 72):
- cmd += "eerror \"%s\" ; " % l
mysettings["EBUILD_PHASE"] = mydo
- portage_exec.spawn(["bash", "-c", cmd],
- env=mysettings.environ())
+ _eerror(mysettings, wrap(msg, 72))
mysettings["EBUILD_PHASE"] = ""
if "userpriv" in mysettings.features and \
if msg:
retval = 1
from textwrap import wrap
- cmd = "source '%s/isolated-functions.sh' ; " % \
- PORTAGE_BIN_PATH
- for l in wrap(msg, 72):
- cmd += "eerror \"%s\" ; " % l
mysettings["EBUILD_PHASE"] = mydo
- portage_exec.spawn(["bash", "-c", cmd],
- env=mysettings.environ())
+ _eerror(mysettings, wrap(msg, 72))
mysettings["EBUILD_PHASE"] = ""
return retval
slot = ""
def eerror(lines):
- cmd = "source '%s/isolated-functions.sh' ; " % PORTAGE_BIN_PATH
- for line in lines:
- for letter in "\\\"$`":
- if letter in line:
- line = line.replace(letter, "\\" + letter)
- cmd += "eerror \"%s\" ; " % line
- portage_exec.spawn(["bash", "-c", cmd],
- env=self.settings.environ())
+ _eerror(self.settings, lines)
if slot != self.settings["SLOT"]:
writemsg("!!! WARNING: Expected SLOT='%s', got '%s'\n" % \