From 79e07763daf0be8a08211834b6689689f8a6e87b Mon Sep 17 00:00:00 2001 From: "J. Lewis Muir" Date: Mon, 27 Mar 2017 15:42:45 -0500 Subject: [PATCH] Add hook support for post_build_hook routine Add hook support for a post_build_hook routine that is executed right after packages have been built by the pkg_comp build subcommand. --- pkg_comp.conf.5 | 4 ++++ pkg_comp.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/pkg_comp.conf.5 b/pkg_comp.conf.5 index bd4eae4..8ce81fd 100644 --- a/pkg_comp.conf.5 +++ b/pkg_comp.conf.5 @@ -245,6 +245,10 @@ In other words, they are run under a shell configured with .Pp The following hooks can be defined: .Bl -tag -width post_build_hookXX +.It Fn post_build_hook +Function executed right after the set of packages have been built by the +.Sq build +command. .It Fn post_fetch_hook Function executed right after all source trees have been updated by the .Sq fetch diff --git a/pkg_comp.sh b/pkg_comp.sh index 309e608..74d43ea 100644 --- a/pkg_comp.sh +++ b/pkg_comp.sh @@ -78,6 +78,7 @@ pkg_comp_set_defaults() { shtk_config_set UPDATE_SOURCES "true" shtk_config_set VARBASE "/var" + post_build_hook() { true; } post_fetch_hook() { true; } } @@ -500,6 +501,8 @@ pkg_comp_build() { run_sandboxctl run /pkg_comp/pbulk/bin/bulkbuild || \ shtk_cli_error "bulkbuild failed; see ${root}/pkg_comp/work/bulklog/" \ "for possible details" + + shtk_config_run_hook post_build_hook }