[matter] change pkgpre hook specifications

This commit is contained in:
Fabio Erculiani
2011-08-06 11:58:08 +02:00
parent 7a18ac3477
commit a903ced289
2 changed files with 9 additions and 7 deletions

View File

@@ -528,8 +528,6 @@ class PackageBuilder(object):
except Exception as exc:
os.kill(pid, signal.SIGTERM)
exit_st = 1
if exit_st != 0:
return exit_st
# run pkgpre, if any
pkgpost = self._params.get("pkgpost")
@@ -542,14 +540,13 @@ class PackageBuilder(object):
try:
# now execute
os.chmod(tmp_path, 0o700)
exit_st = exec_cmd([tmp_path], env = std_env)
if exit_st != 0:
return exit_st
post_exit_st = exec_cmd([tmp_path, str(exit_st)], env = std_env)
if post_exit_st != 0:
return post_exit_st
finally:
os.remove(tmp_path)
# so far, so good
return 0
return exit_st
def _run_builder(self, env):
"""

View File

@@ -49,6 +49,11 @@ removed-useflags: yes
# Valid value is path to executable file
# Env vars:
# MATTER_PACKAGE_NAME = name of the package that would be built
# To the pkgpost hook, is given one argv parameter, corresponding to the
# build exit status, which is 0 for no issues, <0 for warnings, >0 for errors.
# If pkgpost hook returns != 0 exit status, this will replace the exit status
# of the build procedure, which gets returned by build caller (so you have a
# good change of making the whole matter execution abort).
# pkgpost: /home/fabio/repos/entropy/services/matter_examples/pkgpost.sh
# For more info regarding exported environment variables, please see: