From a903ced2893d5052d224c4dd2634abd5837c30a6 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 6 Aug 2011 11:58:08 +0200 Subject: [PATCH] [matter] change pkgpre hook specifications --- services/matter | 11 ++++------- services/matter_examples/zlib.spec | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/services/matter b/services/matter index 3077e7dfd..a41740acc 100755 --- a/services/matter +++ b/services/matter @@ -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): """ diff --git a/services/matter_examples/zlib.spec b/services/matter_examples/zlib.spec index 5bbcb3e48..1d0f6eab7 100644 --- a/services/matter_examples/zlib.spec +++ b/services/matter_examples/zlib.spec @@ -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: