]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
osstest: add support for the FreeBSD package manager
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 13 Jun 2018 07:40:14 +0000 (09:40 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 21 Jun 2018 15:56:55 +0000 (16:56 +0100)
FreeBSD support is added to target_install_packages and
target_install_packages_norec, although there's no equivalent to the
--no-install-recommends in the FreeBSD package manager.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v19: Rework on top of target_run_pkgmanager_install

Changes since v6:
 - Use $ho->{Os} in order to detect the target OS.

Changes since v5:
 - Add prototype for package_install_cmd.
 - Use $ho->{Ident} instead of hardcoding "host" in get_hostflags.

Changes since v4:
 - Unify more code between FreeBSD and Debian: introduce an
   OS-agnostic package_install_cmd to generate the install cmd.

Changes since v3:
 - New in this version.

Osstest/TestSupport.pm

index 5d1f6dc7c7a8eea1a6aae28f0395f15fbafdf282..78538f2ac0c772e3468ab805fe1035f2674c54f3 100644 (file)
@@ -530,11 +530,15 @@ sub target_putfile_root ($$$$;$) {
 sub target_run_pkgmanager_install ($$;$$) {
     my ($ho, $packagelist, $norec, $force) = @_;
     my @cmd;
-    push @cmd, qw(DEBIAN_PRIORITY=critical UCF_FORCE_CONFFOLD=y
-                 with-lock-ex -w /var/lock/osstest-apt apt-get);
-    push @cmd, qw(-f) if $force;
-    push @cmd, qw(--no-install-recommends) if $norec;
-    push @cmd, qw(-y install);
+    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(-f) if $force;
+       push @cmd, qw(--no-install-recommends) if $norec;
+       push @cmd, qw(-y install);
+    }
     push @cmd, @$packagelist;
     target_cmd_root($ho, "@cmd", 3000);
 }