From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Ian Jackson" <Ian.Jackson@eu.citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc.
Date: Thu, 17 May 2018 12:16:58 +0100 [thread overview]
Message-ID: <1526555819-29883-10-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1526555819-29883-1-git-send-email-ian.jackson@eu.citrix.com>
Logically, the final branch of the if should be qualified with a check
for the emptiness of FreeBSDDist. This is awkward in the current
structure, since we really want to do the distpath lookup only if
needed. (This is not very important right now, but we are about to
add another case which will do a more-likely-to-bomb-out and
more-likely-to-block-on-the-db lookup.) So refactor into `return'
style. This lets us introduce local variables in each branch.
Now gate the final branch appropriately. The overall result is that
if no useful FreeBSD build is found, we simply do not set the
freebsd_* runvars, rather than setting them to wrong values (eg,
`freebsd_distpath=/i386'.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
mfi-common | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/mfi-common b/mfi-common
index cef28ad..17b1b50 100644
--- a/mfi-common
+++ b/mfi-common
@@ -133,14 +133,19 @@ set_freebsd_runvars () {
local envvar="FREEBSD_${arch^^}_BUILDJOB"
if [ -n "${!envvar}" ]; then
freebsd_runvars="freebsdbuildjob=${!envvar}"
- elif [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then
+ return
+ fi
+ if [ -n "$FREEBSD_DIST" ] && [ -n "$FREEBSD_VERSION" ]; then
freebsd_runvars="freebsd_distpath=$FREEBSD_DIST/$arch \
freebsd_version=$FREEBSD_VERSION"
- else
- local distpath=`getconfig "FreeBSDDist"`
+ return
+ fi
+ local distpath=`getconfig "FreeBSDDist"`
+ if [ -n "$distpath" ]; then
local version=`getconfig "FreeBSDVersion"`
freebsd_runvars="freebsd_distpath=$distpath/$arch \
freebsd_version=$version"
+ return
fi
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-05-17 11:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 11:16 [OSSTEST PATCH 00/10] UEFI and commissioning fixes Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 01/10] Osstest/TestSupport: Use right arch for UEFI grub setup Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 02/10] Osstest/Debian: preseed: Force UEFI install regardless Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 03/10] README.dev: Fix a typo Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 04/10] README.dev: Discuss setting Firmware for UEFI machines Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 05/10] README.dev: Make example commisioning runes use $hn variable Ian Jackson
2018-05-17 11:16 ` [OSSTEST PATCH 06/10] Perl @INC path: fix a few more scripts to use BEGIN Ian Jackson
2018-05-17 12:53 ` Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 07/10] mg-anoint: Make readonly operations "work" in standalone mode Ian Jackson
2018-05-17 14:20 ` Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 08/10] mg-anoint: Support mg-anoint retrieve --tolerate-unprepared Ian Jackson
2018-05-17 14:22 ` Roger Pau Monné
2018-05-17 11:16 ` Ian Jackson [this message]
2018-05-17 14:26 ` [OSSTEST PATCH 09/10] mfi-common: set_freebsd_runvars: Never set freebsd_distpath to `/amd64' etc Roger Pau Monné
2018-05-17 11:16 ` [OSSTEST PATCH 10/10] mfi-common: Fall back to anointed builds in Executive mode Ian Jackson
2018-05-17 14:29 ` Roger Pau Monné
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=1526555819-29883-10-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=roger.pau@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).