]> xenbits.xensource.com Git - osstest.git/commitdiff
dummy flight generation: cs-hosts-list should not print { }
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 17 Jul 2018 14:51:42 +0000 (14:51 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 14 Aug 2018 10:07:36 +0000 (11:07 +0100)
With newer bash, this causes
      local envvar="FREEBSD_${arch^^}_BUILDJOB"
      if [ -n "${!envvar}" ]; then
to (properly) report a syntax error.

As Roger says, it is better to print a dummy host for each
architecture, so do that.

Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cs-hosts-list

index 6b910ae34741822a42a748dd8ddad87e79f4e35e..384ed46106982e318ef4b4aca39c7afae408b544 100755 (executable)
@@ -92,15 +92,18 @@ my ($flags) = @ARGV;
 my $o;
 
 if ($ENV{'OSSTEST_HOSTSLIST_DUMMY'}) {
-    $o .= "SOMEHOST";
-    if (@arches) {
-       $o .= " $kernels[0]";
-       $o .= " {".join(',',@arches)."}";
+    foreach my $arch (@arches ? @arches : qw(SOMEARCH)) {
+        $o .= "SOMEHOST";
+        $o .= "-\U$arch" if @arches;
+        if (@arches) {
+            $o .= " $kernels[0]";
+            $o .= " $arch";
+        }
+        if (@suites) {
+            $o .= " $suites[0]";
+        }
+        $o .= "\n";
     }
-    if (@suites) {
-       $o .= " $suites[0]";
-    }
-    $o .= "\n";
     print $o or die $!;
     exit 0;
 }