@@ -68,7 +68,6 @@ BEGIN {
http_proxy_envsettings
target_editfile_root target_file_exists
target_editfile_kvp_replace
- target_run_apt
target_install_packages target_install_packages_norec
target_jobdir target_extract_jobdistpath_subdir
target_extract_jobdistpath target_tftp_prefix
@@ -523,19 +522,33 @@ sub target_putfile ($$$$;$) {
sub target_putfile_root ($$$$;$) {
tputfileex('root', @_);
}
-sub target_run_apt {
- my ($ho, @aptopts) = @_;
- target_cmd_root($ho,
- "DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y \\
- with-lock-ex -w /var/lock/osstest-apt apt-get @aptopts", 3000);
+
+sub package_install_cmd ($;$) {
+ my ($ho, $norec) = @_;
+ my @cmd;
+
+ if ($ho->{Os} eq "freebsd") {
+ push @cmd, qw(lockf /var/run/osstest-pkg-lock pkg-static install);
+ } else {
+ push @cmd, qw(DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y
+ with-lock-ex -w /var/lock/osstest-apt apt-get);
+ push @cmd, qw(--no-install-recommends) if $norec;
+ push @cmd, qw(-y install);
+ }
+
+ return @cmd;
}
sub target_install_packages ($@) {
my ($ho, @packages) = @_;
- target_run_apt($ho, qw(-y install), @packages);
+ my @cmd = package_install_cmd($ho);
+
+ target_cmd_root($ho,"@cmd @packages", 3000);
}
sub target_install_packages_norec ($@) {
my ($ho, @packages) = @_;
- target_run_apt($ho, qw(--no-install-recommends -y install), @packages);
+ my @cmd = package_install_cmd($ho, 1);
+
+ target_cmd_root($ho,"@cmd @packages", 3000);
}
sub target_somefile_getleaf ($$$) {