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

[Xen-devel] [OSSTEST PATCH 2/4] mg-hosts: Use ^ for flag negation, not !



We still honour (and document) !

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 README.dev |  2 +-
 mg-hosts   | 19 ++++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/README.dev b/README.dev
index 5787bd8..ddfac30 100644
--- a/README.dev
+++ b/README.dev
@@ -145,7 +145,7 @@ Bless
 Once machines are ready for production use remove the commission
 blessing and add the production ones, e.g.
 
- $ ./mg-hosts setflags mudcake{0,1} -- \!blessed-commission 
blessed-{real,play,adhoc}
+ $ ./mg-hosts setflags mudcake{0,1} -- ^blessed-commission 
blessed-{real,play,adhoc}
 
 
 Shutting down the whole system
diff --git a/mg-hosts b/mg-hosts
index 9ac1990..5361eb6 100755
--- a/mg-hosts
+++ b/mg-hosts
@@ -70,9 +70,9 @@
 #  ./mg-hosts showflags
 #               Print a table showing the flags of all hosts.
 #
-#  ./mg-hosts setflags HOSTGLOB... -|-- !FLAG|-FLAG|FLAG...
-#               Updates some flags of the specified hosts.  !FLAG and
-#               -FLAG both clear the flag; FLAG sets it.
+#  ./mg-hosts setflags HOSTGLOB... -|-- ^FLAG|FLAG...
+#               Updates some flags of the specified hosts.  ^FLAG
+#               (or -FLAG or !FLAG) clears the flag; FLAG sets it.
 #
 #  ./mg-hosts setflagexpr HOSTGLOB... - FLAG EXPR [-|-- FLAG EXPR...]
 #               Sets or clears some flags of the specified hosts,
@@ -84,8 +84,9 @@
 #               decreasing order of precedence):
 #                   FLAG         true iff FLAG is set for the host
 #                   (EXPR)       override precedence
-#                   !EXPR        boolean negation } alternative
-#                   ~EXPR        boolean negation }  equivalent syntax
+#                   ^EXPR        boolean negation } alternative
+#                   ~EXPR        boolean negation }  equivalent
+#                   !EXPR        boolean negation }  syntax
 #                   EXPR&EXPR    boolean "and"
 #                   EXPR|EXPR    boolean inclusive-or
 #               Spaces and tabs are disregarded (outside FLAG names).
@@ -428,8 +429,8 @@ sub cmd_setflags () {
        die unless @$section;
        foreach my $flagorig (@$section) {
            my $flag = $flagorig;
-           # each flag may start with - or ! to remove
-            my $remove= $flag =~ s/^[-!]//;
+           # each flag may start with ^ (or - or !) to remove
+            my $remove= $flag =~ s/^[-!^]//;
            setflagval($dst,$flag,!$remove);
         }
     });
@@ -443,14 +444,14 @@ END
        my ($dst,$section) = @_;
        die unless @$section == 2;
        my ($dstflag, $expr) = @$section;
-       die "$expr $& ?" if $expr =~ m/[^-0-9a-z_&|()!~ \t]/;
+       die "$expr $& ?" if $expr =~ m/[^-0-9a-z_&|()!~ \t^]/;
 
        my %inputs;
        $expr =~ s{[-0-9a-z_]+}{
                 $inputs{$&} = undef;
                 " \$inputs{'$&'} ";
             }ge;
-       $expr =~ s/\~/!/g;
+       $expr =~ s/[~^]/!/g;
        $expr =~ s/[&|]/$&$&/g;
 
        foreach my $flagorig (sort keys %inputs) {
-- 
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®.