@@ -88,9 +88,9 @@ sub setup {
}
print $F "APT::Install-Recommends false;\n";
- if ($self->get('Host_Arch') ne $self->get('Build_Arch')) {
- print $F "APT::Architecture=".$self->get('Host_Arch');
- print STDOUT "Adding APT::Architecture".$self->get('Host_Arch')."to the apt config";
+ if ($self->get_conf('HOST_ARCH') ne $self->get_conf('BUILD_ARCH')) {
+ print $F "APT::Architecture=".$self->get_conf('HOST_ARCH');
+ $self->log("Adding APT::Architecture" . $self->get_conf('HOST_ARCH') . " to the apt config\n");
}
if ($self->get('Split')) {
print $F "Dir \"$chroot_dir\";\n";
@@ -133,13 +133,19 @@ sub setup {
sub setup_dpkg {
my $self = shift;
-
- #if cross-building we need to set the correct foreign-arch
- if ($self->get('Host_Arch') ne $self->get('Build_Arch')) {
- open (my $F, '>/etc/dpkg/dpkg.cfg.d/sbuild');
- print $F "foreign-architecture ".$self->get('Host_Arch');
- close ($F);
- print "Setting dpkg foreign-architecutre";
+
+ my $session = $self->get('Session');
+
+ #if cross-building set the correct foreign-arch
+ if ($self->get_conf('HOST_ARCH') ne $self->get_conf('BUILD_ARCH')) {
+
+ $session->run_command(
+ { COMMAND => ['echo', 'foreign-architecture ' . $self->get_conf('HOST_ARCH'), '>', '/etc/dpkg/dpk.cfg.d/sbuild'],
+ USER => 'root' });
+ # We should get this much nicer interface with new dpkg upload.
+ # { COMMAND => ['dpkg', '--add-foreign-architecture ', $self->get_conf('HOST_ARCH')],
+ # USER => 'root' });
+ $self->log("Setting dpkg foreign-architecture\n");
}
}
From: Wookey <wookey@wookware.org> --- lib/Sbuild/ResolverBase.pm | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-)