Control: tag -1 + patch pending Hi,
On Wed, 09 Dec 2015 23:35:40 +0100 Johannes Schauer <jo...@debian.org> wrote: > I need to investigate this further... phew... this was an odd bug. It turns out that the APT_CONFIG environment variable set in ResolverBase.pm was never seen by apt because the ENVIRONMENT_FILTER configuration option would not let this environment variable reach the final executable. I don't think it's desirable that the ENVIRONMENT_FILTER configuration variable is able to undo environment variable settings done in the sbuild codebase itself. Therefore I fixed this bug by moving the setting of sbuild supplied environment variables to *after* the code cleaning environment variables using the ENVIRONMENT_FILTER configuration option: diff --git a/lib/Sbuild/Chroot.pm b/lib/Sbuild/Chroot.pm index 366fb1e..fa16cc8 100644 --- a/lib/Sbuild/Chroot.pm +++ b/lib/Sbuild/Chroot.pm @@ -273,16 +273,6 @@ sub exec_command { my $program = $command->[0]; $program = $options->{'PROGRAM'} if defined($options->{'PROGRAM'}); - my $chrootenv = $self->get('Defaults')->{'ENV'}; - foreach (keys %$chrootenv) { - $ENV{$_} = $chrootenv->{$_}; - } - - my $commandenv = $options->{'ENV'}; - foreach (keys %$commandenv) { - $ENV{$_} = $commandenv->{$_}; - } - my @filter; my $chrootfilter = $self->get('Defaults')->{'ENV_FILTER'}; push(@filter, @{$chrootfilter}); @@ -306,6 +296,16 @@ sub exec_command { } } + my $chrootenv = $self->get('Defaults')->{'ENV'}; + foreach (keys %$chrootenv) { + $ENV{$_} = $chrootenv->{$_}; + } + + my $commandenv = $options->{'ENV'}; + foreach (keys %$commandenv) { + $ENV{$_} = $commandenv->{$_}; + } + debug2("PROGRAM: $program\n"); debug2("COMMAND: ", join(" ", @{$options->{'COMMAND'}}), "\n"); debug2("COMMAND_STR: ", $options->{'COMMAND'} // 'UNDEFINED', "\n"); Thanks! cheers, josch
signature.asc
Description: signature