]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
mg-allocate: Use ^ for deallocation, not !
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 3 May 2018 14:28:59 +0000 (15:28 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 3 May 2018 14:51:00 +0000 (15:51 +0100)
! is annoying because some shells enable !-history expantion by
default even though few users have any idea about it.  In general users
are confused by the error message and do not know what to do next.

We still honour ! for the benefit of old wrapper scripts, finger
macros, etc.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
README.dev
mg-allocate
mg-schema-test-database

index 95fc66c76cee572cdbbd3b35b2ee0f5b2e305844..5787bd8d6950cd4b431aa289c9cba8a37344590c 100644 (file)
@@ -13,10 +13,10 @@ e.g.
 $ ./mg-hosts manual-task-create ianc@kazak
 
 Borrow, estimating 1 day duration (for the planner):
-$ ./mg-allocate -U 1d marilith-n5 
+$ ./mg-allocate -U 1d marilith-n5
 
 Return (not automatic, even with an estimate given):
-$ ./mg-allocate \!marilith-n5 
+$ ./mg-allocate ^marilith-n5
 
 Removing machines for servicing/outage
 ======================================
index c30dd1501b1fa352b8f149d3aec7965f18a79118..087b14b029933032b96297780bd87ee18564521a 100755 (executable)
@@ -5,11 +5,11 @@
 #  ./mg-allocate [-l] [-l] [-l]
 #
 # <resource-spec> syntax:
-#   [!][<type>/]<name>[/<share>]      type defaults to 'host'
+#   [^][<type>/]<name>[/<share>]      type defaults to 'host'
 #                                     type=='S' means 'shared-host'
 #                                     type=='F' means 'shared-flight'
 #                                     share defaults to *
-#                                     "!" prefix means deallocate
+#                                     "^" prefix (or "!") means deallocate
 #                                     name=option|option|... means
 #                                       any one of those options
 #                                     option={flag,flag...} means anything
@@ -38,7 +38,7 @@
 #                  be owned by the current task (or perhaps by a task
 #                  named in --steal).
 #
-#                  Not compatible with the !<resource> deallocation
+#                  Not compatible with the ^<resource> deallocation
 #                  syntax: donation implies deallocation, in a sense.
 #
 #   --steal <task-spec>
@@ -125,7 +125,7 @@ END
 sub parse_1res ($) {
     my ($res) = @_;
 
-    $res =~ m,^(\!?) (?: ([^/]+)/ )? ([^/]+) (?: /(\d+|\*) )?$,x
+    $res =~ m,^([!^]?) (?: ([^/]+)/ )? ([^/]+) (?: /(\d+|\*) )?$,x
         or die "bad resource $res ?";
     my $allocate= !$1;
     my $restype= defined($2) ? $2 : 'host';
index 641aadb7e67c1191bb0a11317f43c7b46c41f862..6aeedd1045fdc88bc0f716e0ff37ecccd32c4711 100755 (executable)
@@ -71,7 +71,7 @@
 #    ./mg-schema-test-database drop [_SUFFIX]
 #   This will throw away all of the information in the test DB.
 #
-#  5. OSSTEST_TASK=iwj@testing ./mg-allocate !a-host
+#  5. OSSTEST_TASK=iwj@testing ./mg-allocate ^a-host
 #   Hosts that were marked in the main DB as borrowed, are returned by
 #   mg-schema-test-database to the main DB task that previously owned
 #   them, but not freed.  So you need to explicitly free them.