summaryrefslogtreecommitdiffstats
path: root/lib/Sbuild/Build.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sbuild/Build.pm')
-rw-r--r--lib/Sbuild/Build.pm20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index cca1c89..7a23a85 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -640,13 +640,6 @@ END
debug("Error run_chroot_session(): $@") if $@;
- if ($self->get('Pkg Status') ne "successful") {
- if(!$self->run_external_commands("post-build-failed-commands")) {
- Sbuild::Exception::Build->throw(error => "Failed to execute post-build-commands",
- failstage => "run-post-build-failed-commands");
- }
- }
-
# End chroot session
my $session = $self->get('Session');
if (defined $session) {
@@ -833,6 +826,9 @@ sub run_fetch_install_packages {
$self->set('Install Start Time', time);
$self->set('Install End Time', $self->get('Install Start Time'));
my @coredeps = @{$self->get_conf('CORE_DEPENDS')};
+ if ($self->get_conf('CHROOT_MODE') eq 'unshare') {
+ push(@coredeps, 'dumb-init');
+ }
if ($self->get('Host Arch') ne $self->get('Build Arch')) {
my $crosscoredeps = $self->get_conf('CROSSBUILD_CORE_DEPENDS');
if (defined($crosscoredeps->{$self->get('Host Arch')})) {
@@ -1010,6 +1006,13 @@ sub run_fetch_install_packages {
}
}
+ if ($self->get('Pkg Status') ne "successful") {
+ if(!$self->run_external_commands("post-build-failed-commands")) {
+ Sbuild::Exception::Build->throw(error => "Failed to execute post-build-commands",
+ failstage => "run-post-build-failed-commands");
+ }
+ }
+
$self->log_subsection("Cleanup");
my $session = $self->get('Session');
my $resolver = $self->get('Dependency Resolver');
@@ -2593,7 +2596,8 @@ sub build {
PRIORITY => 0,
DIR => $dscdir,
STREAMERR => \*STDOUT,
- DISABLE_NETWORK => 1,
+ ENABLE_NETWORK => $self->get_conf('ENABLE_NETWORK'),
+ BUILD_INSIDE_INIT => 1,
};
my $pipe = $session->pipe_command($command);