diff mbox series

[OSSTEST,3/3] ts-memdisk-try-append: Call selecthost

Message ID 20200310120802.31625-3-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/3] ts-memdisk-try-append: Add missing -I | expand

Commit Message

Ian Jackson March 10, 2020, 12:08 p.m. UTC
In 7f49abaa0ff91d6dc1592ea80f10211c52fb03c4
  arch replumbing: Replace many $r{arch} with $[g]ho->{Arch}
I accidentally broke this, by not spotting that the perl fragment
did not call selecthost and has no $ho.

Fix this as follows:
  * Pass all of the -try-append arguments to the perl rune.
  * Include a simple replica of the arg parsing of
    ts-freebsd-host-install (notably, we don't parse options,
    and instead assume the host comes last).
  * Call selecthost.

Compared to the situation prior to 7f49abaa0ff9, we now check that the
host is allocated to us, etc., before looking at what arch the job
specifies.  Additionally, we would now honour host_arch if it were
different to arch.  (Currently, it isn't.)

CC: Roger Pau Monné <royger@FreeBSD.org>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-memdisk-try-append | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ts-memdisk-try-append b/ts-memdisk-try-append
index 2fe18f45..4b54eff0 100755
--- a/ts-memdisk-try-append
+++ b/ts-memdisk-try-append
@@ -23,8 +23,13 @@  arch=`perl -I. -e '
                 use Osstest::TestSupport;
 
                 tsreadconfig();
+
+		our $whhost = pop @ARGV; # arg parsing bodge
+		$whhost ||= "host";
+		our $ho = selecthost($whhost);
+
                 print $ho->{Arch} or die $!;
-              '`
+              ' "$@"`
 
 case "$arch" in
 amd64)