From df094f79a67c0835b0fddd73019b09951ed26987 Mon Sep 17 00:00:00 2001 From: josch Date: Wed, 4 Jun 2014 22:57:36 +0200 Subject: [PATCH] add pre-realbuild-commands and post-realbuild-commands --- lib/Sbuild/Build.pm | 15 +++++++++++++++ lib/Sbuild/Conf.pm | 2 ++ lib/Sbuild/Options.pm | 10 ++++++++++ 3 files changed, 27 insertions(+) diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm index a24b575..c8552de 100644 --- a/lib/Sbuild/Build.pm +++ b/lib/Sbuild/Build.pm @@ -1060,6 +1060,12 @@ sub run_external_commands { } elsif ($stage eq "chroot-setup-commands") { $self->log_subsection("Chroot Setup Commands"); $chroot = 1; + } elsif ($stage eq "pre-realbuild-commands") { + $self->log_subsection("Pre RealBuild Commands"); + $chroot = 1; + } elsif ($stage eq "post-realbuild-commands") { + $self->log_subsection("Post RealBuild Commands"); + $chroot = 1; } elsif ($stage eq "chroot-cleanup-commands") { $self->log_subsection("Chroot Cleanup Commands"); $chroot = 1; @@ -1383,6 +1389,10 @@ sub build { return 0; } + $self->run_external_commands("pre-realbuild-commands", + $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), + $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); + $self->set('Build Start Time', time); $self->set('Build End Time', $self->get('Build Start Time')); @@ -1564,6 +1574,11 @@ sub build { $self->log_sep(); $self->log("Build finished at $finish_date\n"); + + $self->run_external_commands("post-realbuild-commands", + $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), + $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); + my @space_files = ("$dscdir"); $self->log_subsubsection("Finished"); diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm index 25ec66d..a396821 100644 --- a/lib/Sbuild/Conf.pm +++ b/lib/Sbuild/Conf.pm @@ -975,6 +975,8 @@ sub setup ($) { DEFAULT => { "pre-build-commands" => [], "chroot-setup-commands" => [], + "pre-realbuild-commands" => [], + "post-realbuild-commands" => [], "chroot-cleanup-commands" => [], "post-build-commands" => [], }, diff --git a/lib/Sbuild/Options.pm b/lib/Sbuild/Options.pm index 4a232bf..fbca939 100644 --- a/lib/Sbuild/Options.pm +++ b/lib/Sbuild/Options.pm @@ -267,6 +267,16 @@ sub set_options { push(@{${$self->get_conf('EXTERNAL_COMMANDS')}{"chroot-setup-commands"}}, \@command); }, + "pre-realbuild-commands=s" => sub { + my @command = split(/\s+/, $_[1]); + push(@{${$self->get_conf('EXTERNAL_COMMANDS')}{"pre-realbuild-commands"}}, + \@command); + }, + "post-realbuild-commands=s" => sub { + my @command = split(/\s+/, $_[1]); + push(@{${$self->get_conf('EXTERNAL_COMMANDS')}{"post-realbuild-commands"}}, + \@command); + }, "chroot-cleanup-commands=s" => sub { my @command = split(/\s+/, $_[1]); push(@{${$self->get_conf('EXTERNAL_COMMANDS')}{"chroot-cleanup-commands"}}, -- 1.9.2