diff mbox

[2352/2353] Add an error check in dpkg_setup, and fix up whitespace

Message ID 1324306056-23512-1-git-send-email-wookey@wookware.org
State Accepted
Headers show

Commit Message

Wookey Dec. 19, 2011, 2:47 p.m. UTC
From: Wookey <wookey@wookware.org>

---
 lib/Sbuild/ResolverBase.pm |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/lib/Sbuild/ResolverBase.pm b/lib/Sbuild/ResolverBase.pm
index 963e194..06ac8fc 100644
--- a/lib/Sbuild/ResolverBase.pm
+++ b/lib/Sbuild/ResolverBase.pm
@@ -140,11 +140,15 @@  sub setup_dpkg {
 	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' });
+		{ COMMAND => ['echo', '"foreign-architecture ' . $self->get_conf('HOST_ARCH') . '"', '>', '/etc/dpkg/dpkg.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' });
+		if ($?) {
+			$self->log_error("E: Failed to set dpkg foreign-architecture config\n");
+			return 0;
+		}
 		$self->log("Setting dpkg foreign-architecture\n");
 	}
 }