[buildd-tools-devel] Bug#807488: Bug#807488: Bug#807488: sbuild-update: please run -d with --no-install-recommends

Johannes Schauer josch at debian.org
Fri Dec 25 22:03:57 UTC 2015


Control: tag -1 + patch pending

Hi,

On Wed, 09 Dec 2015 23:35:40 +0100 Johannes Schauer <josch at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20151225/3c444be7/attachment.sig>


More information about the Buildd-tools-devel mailing list