From patchwork Wed Dec 14 18:10:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wookey X-Patchwork-Id: 5719 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2D39423E0C for ; Wed, 14 Dec 2011 18:10:19 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 20269A1883D for ; Wed, 14 Dec 2011 18:10:19 +0000 (UTC) Received: by eaak10 with SMTP id k10so996412eaa.11 for ; Wed, 14 Dec 2011 10:10:19 -0800 (PST) Received: by 10.204.156.208 with SMTP id y16mr1751071bkw.72.1323886218882; Wed, 14 Dec 2011 10:10:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs15787bkc; Wed, 14 Dec 2011 10:10:18 -0800 (PST) Received: by 10.52.67.111 with SMTP id m15mr5732536vdt.96.1323886216816; Wed, 14 Dec 2011 10:10:16 -0800 (PST) Received: from stoneboat.aleph1.co.uk (stoneboat.aleph1.co.uk. [80.68.88.63]) by mx.google.com with ESMTPS id w7si2106613wec.8.2011.12.14.10.10.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 10:10:16 -0800 (PST) Received-SPF: neutral (google.com: 80.68.88.63 is neither permitted nor denied by best guess record for domain of wookey@wookware.org) client-ip=80.68.88.63; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.68.88.63 is neither permitted nor denied by best guess record for domain of wookey@wookware.org) smtp.mail=wookey@wookware.org Received: from host-78-151-164-206.static.as13285.net ([78.151.164.206] helo=dream.aleph1.co.uk) by stoneboat.aleph1.co.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RatHO-0006Hn-7T for patches@linaro.org; Wed, 14 Dec 2011 18:10:16 +0000 Received: from wookey by dream.aleph1.co.uk with local (Exim 4.72) (envelope-from ) id 1RatHI-0006Sl-0n for patches@linaro.org; Wed, 14 Dec 2011 18:10:04 +0000 Date: Wed, 14 Dec 2011 18:10:03 +0000 From: Wookey To: patches@linaro.org Message-ID: <20111214181003.GY28260@dream.aleph1.co.uk> MIME-Version: 1.0 Content-Disposition: inline Organization: Wookware User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: 78.151.164.206 X-SA-Exim-Mail-From: wookey@wookware.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on stoneboat.aleph1.co.uk X-Spam-Level: X-Spam-Status: No, score=-2.1 required=4.5 tests=AWL,BAYES_00 autolearn=no version=3.3.1 Subject: 0011-Dirty-commit-to-hook-cross-dependency-resolver.patch X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk) >From 0a8de71ba8ca4422c77b46c4ce8f0485e5d43ce6 Mon Sep 17 00:00:00 2001 From: Hector Oron Date: Mon, 12 Dec 2011 19:21:29 +0000 Subject: [PATCH 11/17] Dirty commit to hook cross dependency resolver $ sbuild -d sid-amd64-sbuild --host=armel --build=amd64 --build-dep-resolver=xapt mc_4.7.0.9-1.dsc This is a work-in-progress... trying to get it working: 1. xapt -a $host_arch $pkg_list 2. cd $source_dir && embuilddeps -a $host_arch xapt is probably best way to go, but we need a list of packages Signed-off-by: Hector Oron --- lib/Sbuild/Conf.pm | 4 ++++ lib/Sbuild/ResolverBase.pm | 27 +++++++++++++++++++++++---- lib/Sbuild/XaptResolver.pm | 11 +++++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm index b5b962a..c1100c5 100644 --- a/lib/Sbuild/Conf.pm +++ b/lib/Sbuild/Conf.pm @@ -257,6 +257,10 @@ sub setup ($) { CHECK => $validate_program, DEFAULT => 'xapt' }, + 'EMBUILDDEPS' => { + CHECK => $validate_program, + DEFAULT => 'embuilddeps' + }, 'DPKG_BUILDPACKAGE_USER_OPTIONS' => { TYPE => 'ARRAY:STRING', GROUP => '__INTERNAL', diff --git a/lib/Sbuild/ResolverBase.pm b/lib/Sbuild/ResolverBase.pm index d2362bd..8917cb8 100644 --- a/lib/Sbuild/ResolverBase.pm +++ b/lib/Sbuild/ResolverBase.pm @@ -448,10 +448,12 @@ sub run_xapt { # dpkg since 1.4.1.18 issues an error on the conffile question if # it reads EOF -- hardwire the new --force-confold option to avoid # the questions. - my @xapt_command = ($self->get_conf('XAPT'), - '-a', $self->get_conf('HOST_ARCH')); - # FIXME?:push @xapt_command, "$mode", $action, @packages; - push @xapt_command, @packages; + use Data::Dumper; + debug("Source Dir = " . $self->get('Source Dir') . "\n"); + print "Dump Source Dir\n"; + print Dumper ($self->get('Source Dir')); + # chdir ($dir); + my @xapt_command = ($self->get_conf('EMBUILDDEPS')); my $pipe = $self->pipe_xapt_command( { COMMAND => \@xapt_command, @@ -1056,6 +1058,23 @@ sub pipe_apt_command { } } +sub pipe_xapt_command { + my $self = shift; + my $options = shift; + + my $session = $self->get('Session'); + my $host = $self->get('Host'); + + # Set modfied command + $self->get_apt_command_internal($options); + + if ($self->get('Split')) { + return $host->pipe_command_internal($options); + } else { + return $session->pipe_command_internal($options); + } +} + sub get_aptitude_command_internal { my $self = shift; my $options = shift; diff --git a/lib/Sbuild/XaptResolver.pm b/lib/Sbuild/XaptResolver.pm index 6bc9309..ea795a1 100644 --- a/lib/Sbuild/XaptResolver.pm +++ b/lib/Sbuild/XaptResolver.pm @@ -56,11 +56,11 @@ sub install_deps { my $status = 0; my $session = $self->get('Session'); - my $dummy_pkg_name = 'sbuild-build-depends-' . $name. '-dummy'; +# my $dummy_pkg_name = 'sbuild-build-depends-' . $name. '-dummy'; # Call functions to setup an archive to install dummy package. - return 0 unless ($self->setup_apt_archive($dummy_pkg_name, @pkgs)); - return 0 unless (!$self->update_archive()); +# return 0 unless ($self->setup_apt_archive($dummy_pkg_name, @pkgs)); +# return 0 unless (!$self->update_archive()); $self->log_subsection("Install $name cross-build dependencies (xapt-based resolver)"); @@ -68,7 +68,10 @@ sub install_deps { # Install the dummy package my (@instd, @rmvd); $self->log("Installing cross-build dependencies\n"); - if (!$self->run_apt("-yf", \@instd, \@rmvd, 'install', $dummy_pkg_name)) { +# if (!$self->run_apt("-yf", \@instd, \@rmvd, 'install', $dummy_pkg_name)) { + print "checking pwd\n"; + system("pwd"); + if (!$self->run_xapt("-a", $self->get_conf('HOST_ARCH'))) { $self->log("Package installation failed\n"); if (defined ($self->get('Session')->get('Session Purged')) && $self->get('Session')->get('Session Purged') == 1) {