Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook support for post_build_hook routine #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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