@@ -70,6 +70,9 @@ sub setup {
my $session = $self->get('Session');
my $chroot_dir = $session->get('Location');
+ #Set up dpkg config
+ $self->setup_dpkg();
+
my $aptconf = "/var/lib/sbuild/apt.conf";
$self->set('APT Conf', $aptconf);
@@ -84,7 +87,11 @@ sub setup {
print $F "APT::Get::AllowUnauthenticated true;\n";
}
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('Split')) {
print $F "Dir \"$chroot_dir\";\n";
}
@@ -124,6 +131,18 @@ sub setup {
$self->cleanup_apt_archive();
}
+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";
+ }
+}
+
sub cleanup {
my $self = shift;
From: Wookey <wookey@wookware.org> --- lib/Sbuild/ResolverBase.pm | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-)