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.jack...@eu.citrix.com>
---
 mfi-common | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/mfi-common b/mfi-common
index fddd1ce..a482463 100644
--- a/mfi-common
+++ b/mfi-common
@@ -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
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to