From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 06/12] TestSupport: break out target_run_apt Date: Tue, 11 Feb 2014 15:25:48 +0000 Message-ID: <1392132354-7594-7-git-send-email-ian.jackson@eu.citrix.com> References: <1392132354-7594-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WDFEB-000885-Gp for xen-devel@lists.xenproject.org; Tue, 11 Feb 2014 15:26:27 +0000 In-Reply-To: <1392132354-7594-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org We are going to add some environment variables to the apt invocation, so centralise where this happens. No functional change. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index a513540..e546dc9 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -56,6 +56,7 @@ BEGIN { target_putfilecontents_root_stash target_put_guest_image target_editfile_root target_file_exists + target_run_apt target_install_packages target_install_packages_norec target_extract_jobdistpath target_guest_lv_name @@ -416,16 +417,21 @@ sub target_putfile ($$$$;$) { sub target_putfile_root ($$$$;$) { tputfileex('root', @_); } +sub target_run_apt { + my ($ho, $timeout, @aptopts) = @_; + target_cmd_root($ho, + "apt-get @aptopts", + $timeout); +} sub target_install_packages { my ($ho, @packages) = @_; - target_cmd_root($ho, "apt-get -y install @packages", - 300 + 100 * @packages); + target_run_apt($ho, 300 + 100 * @packages, + qw(-y install), @packages); } sub target_install_packages_norec { my ($ho, @packages) = @_; - target_cmd_root($ho, - "apt-get --no-install-recommends -y install @packages", - 300 + 100 * @packages); + target_run_apt($ho, 300 + 100 * @packages, + qw(--no-install-recommends -y install), @packages); } sub target_somefile_getleaf ($$$) { -- 1.7.10.4