blob: f95e1999aa4d614336932eac0196e0b9ccffb813 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import elog_modules.mod_save, portage.exec, portage.exception
def process(mysettings, cpv, logentries, fulltext):
elogfilename = elog_modules.mod_save.process(mysettings, cpv, logentries, fulltext)
if (not "PORTAGE_ELOG_COMMAND" in mysettings.keys()) \
or len(mysettings["PORTAGE_ELOG_COMMAND"]) == 0:
raise portage.exception.MissingParameter("!!! Custom logging requested but PORTAGE_ELOG_COMMAND is not defined")
else:
mylogcmd = mysettings["PORTAGE_ELOG_COMMAND"]
mylogcmd = mylogcmd.replace("${LOGFILE}", elogfilename)
mylogcmd = mylogcmd.replace("${PACKAGE}", cpv)
retval = portage.exec.spawn_bash(mylogcmd)
if retval != 0:
raise portage.exception.PortageException("!!! PORTAGE_ELOG_COMMAND failed with exitcode %d" % retval)
return
|