From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v6 11/20] osstest: add support for the FreeBSD package manager
Date: Mon, 24 Jul 2017 12:07:50 +0100 [thread overview]
Message-ID: <20170724110759.2638-12-roger.pau@citrix.com> (raw)
In-Reply-To: <20170724110759.2638-1-roger.pau@citrix.com>
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>
---
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 | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index c4c49c10..184dd516 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -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,34 @@ 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 @hostflags = get_hostflags($ho->{Ident});
+ my @cmd;
+
+ if (grep /^freebsd\b/i, @hostflags) {
+ 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 ($$$) {
--
2.11.0 (Apple Git-81)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-07-24 11:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-24 11:07 [PATCH v6 00/20] osstest: initial FreeBSD support Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 01/20] osstest: make built_stash_file store a path_ runvar for each file Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 02/20] osstest: move known_hosts generation to TestSupport Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 03/20] osstest: introduce helper to get per-host tftp prefix Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 04/20] osstest: introduce a helper to calculate the sha256 of a given file Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 05/20] osstest: introduce a helper to setup a host to boot using memdisk Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 06/20] osstest: add executive prefix to resource_shared_mark_ready Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 07/20] osstest: introduce resource_shared_mark_ready Roger Pau Monne
2017-10-27 16:19 ` Ian Jackson
2017-07-24 11:07 ` [PATCH v6 08/20] osstest: add a FreeBSD host install script Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 09/20] osstest: introduce build helpers for FreeBSD Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 10/20] osstest: add prototypes to target_install_packages{_norec} Roger Pau Monne
2017-07-25 13:20 ` Ian Jackson
2017-07-24 11:07 ` Roger Pau Monne [this message]
2017-07-24 11:07 ` [PATCH v6 12/20] osstest: introduce a FreeBSD build script Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 13/20] osstest: add support for runtime_IDENT_hostflags Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 14/20] osstest: introduce a script to set the runtime hostflags runvar for FreeBSD jobs Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 15/20] osstest: change the meaning of need_build_host Roger Pau Monne
2017-07-24 15:28 ` Ian Jackson
2017-07-24 11:07 ` [PATCH v6 16/20] osstest: add support for FreeBSD buildjobs to sg-run-job Roger Pau Monne
2017-07-24 15:29 ` Ian Jackson
2017-07-24 11:07 ` [PATCH v6 17/20] osstest: introduce a script to create a FreeBSD flight Roger Pau Monne
2017-07-24 15:38 ` Ian Jackson
2017-07-24 15:45 ` Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 18/20] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
2017-07-24 15:44 ` Ian Jackson
2017-07-24 16:03 ` Roger Pau Monne
2017-07-24 16:13 ` Ian Jackson
2017-07-25 7:17 ` Roger Pau Monne
2017-07-24 11:07 ` [PATCH v6 19/20] osstest: save/retrieve the last successfully tested FreeBSD build Roger Pau Monne
2017-07-24 15:56 ` Ian Jackson
2017-07-25 7:56 ` Roger Pau Monne
2017-07-25 10:24 ` Ian Jackson
2017-07-25 12:06 ` Roger Pau Monne
2017-07-25 13:21 ` Ian Jackson
2017-07-24 11:07 ` [PATCH v6 20/20] osstest: add anoint dummy script Roger Pau Monne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170724110759.2638-12-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).