Skip to content

Conversation

@jlmuir
Copy link
Contributor

@jlmuir jlmuir commented Mar 27, 2017

Add hook support for a post_build_hook routine that is executed right after packages have been built by the pkg_comp build subcommand.

This enables me to, for example, define a post_build_hook function in /usr/local/etc/pkg_comp/default.conf to preserve the pbulk log outside of the sandbox after the build finishes but before the sandbox gets destroyed:

post_build_hook() {
  local logdir bulklog sandbox_bulklog
  logdir=/var/pkg_comp/log
  bulklog=$logdir/bulklog
  sandbox_bulklog=/var/pkg_comp/sandbox/pkg_comp/work/bulklog
  [ ! -e "$sandbox_bulklog" ] && return
  if [ -e "$bulklog" ]; then
    rm -rf "$bulklog.old"
    mv "$bulklog" "$bulklog.old"
  fi
  mkdir -p "$logdir"
  cp -rp "$sandbox_bulklog" "$bulklog"
}

Add hook support for a post_build_hook routine that is executed right
after packages have been built by the pkg_comp build subcommand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant