]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ktest.pl: Have -D option work without a space
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 18 Jul 2025 20:18:43 +0000 (16:18 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 21 Jul 2025 20:31:04 +0000 (16:31 -0400)
Allow -DBUILD_TYPE=boot work the same as -D BUILD_TYPE=boot just like
normal single character option does in most applications.

Cc: "John Warthog9 Hawley" <warthog9@kernel.org>
Cc: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/20250718202053.567246162@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index 7b94b9b83ee781532cceee0a8698f55db26e002b..95e62929cda7d9d5148cf27ae0772a0cd09e5f4c 100755 (executable)
@@ -4297,6 +4297,15 @@ while ( $#ARGV >= 0 ) {
            $command_vars[$#command_vars + 1] = $val;
        }
 
+    } elsif ( $ARGV[0] =~ m/^-D(.*)/) {
+       my $val = $1;
+       shift;
+
+       if ($val =~ m/(.*?):=(.*)$/) {
+           set_variable($1, $2, 1);
+       } else {
+           $command_vars[$#command_vars + 1] = $val;
+       }
     } elsif ( $ARGV[0] eq "-h" ) {
        die_usage;
     } else {