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

[Xen-devel] [OSSTEST PATCH 1/3] mg-hosts mknetbootdir: Improve sub-option parser


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Thu, 29 Aug 2019 10:17:17 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Thu, 29 Aug 2019 09:18:22 +0000
  • Ironport-sdr: t48knbqXlKGTfwoTo0XwGZ0YwJMGwGRlHCxK0GgokOM6Pvt/jNfELo5Qgq/aOlSyEy9gd1EBYC zEpXRwcYbBlhjDJLUNUHBcsLSpXGlAaQLcLQOZUj1CneeLmPuk5QNcTAN7UekGrHyh5hm2nU1n laAGhUPEFb8OlY9BIrd7o30gwGDXfHnJqz+960wYAWhhyQBoZ+Iw4rDj5Vlmd6GJXGJmN5s6TY khz6I0v1eVBUkxertHIKMui9tLoR8HZqi58B/nx2NYVG5A9FN7JddaWdHcLpoGbYwASsG6lA4z l+g=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

No semantic change.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 mg-hosts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mg-hosts b/mg-hosts
index 58b4acc3..d68f7b4e 100755
--- a/mg-hosts
+++ b/mg-hosts
@@ -121,7 +121,14 @@ sub l ($) { return split /,/, $_[0]; }
 
 sub cmd_mknetbootdir () {
     my $dryrun = 0;
-    if (@ARGV && $ARGV[0] eq '-n') { shift @ARGV; $dryrun= 1; }
+    while (@ARGV && $ARGV[0] =~ m/^-/) {
+       $_ = shift @ARGV;
+       last if $_ =~ m/^--?$/;
+       while (m/^-./) {
+           if (s/^-n/-/) { $dryrun= 1; }
+           else { die "unknown mknetbootdir option $_"; }
+       }
+    }
     die unless @ARGV>=1;
     my $sudo = $ENV{'OSSTEST_SUDO'} // 'sudo';
     foreach my $hn (@ARGV) {
-- 
2.11.0


_______________________________________________
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®.