]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
mfi-*: Provide hostflags_strip
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 6 Jun 2018 10:45:05 +0000 (11:45 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 6 Jun 2018 10:45:05 +0000 (11:45 +0100)
This utility function saves us having to fragment the *_hostflags
variables any further when adding special cases.  A particular special
case can strip out things it doesn't like.

No callers yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
mfi-common

index fddd1ce98052870a66291e100ffd2632c7aa1909..a482463578cd55e0715715c4428548565dc663a0 100644 (file)
@@ -102,6 +102,16 @@ job_create_build () {
   ./cs-job-create $flight $job $recipe $global_runvars "$@"
 }
 
+hostflags_strip () {
+  # prints $1, which is a list of hostflags, with hostflags
+  # matching the perl regexp $2 removed
+  perl -Mstrict -we '
+           my @f = split /\,/, $ARGV[0];
+           @f = grep { !m{$ARGV[1]} } @f;
+           print join ",", @f or die $!;
+         ' "$@"
+}
+
 set_hostos_runvars () {
   # caller should have done
   #    local hostos_runvars