From 5d1d7ccc457ba6a4f1226bf14d3245942275e1c0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 10 Feb 2014 16:34:52 +0000 Subject: [PATCH] TestSupport: break out target_run_apt 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 ($$$) { -- 2.39.5