[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 2/3] mfi-*: Provide hostflags_strip



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@xxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.