Commit 51ad1dd1034684e9c490eb41c17cde8ffb682ab1

Authored by Steven Rostedt
Committed by Steven Rostedt
1 parent d1e2f22ad7

ktest: Use $output_config instead of typing $outputdir/.config

To help prevent typos, use $output_config as the reference to
"$outputdir/.config".

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Showing 1 changed file with 10 additions and 8 deletions Side-by-side Diff

tools/testing/ktest/ktest.pl
... ... @@ -46,6 +46,7 @@
46 46 my $tmpdir;
47 47 my $builddir;
48 48 my $outputdir;
  49 +my $output_config;
49 50 my $test_type;
50 51 my $build_type;
51 52 my $build_options;
... ... @@ -389,8 +390,8 @@
389 390 mkpath($faildir) or
390 391 die "can't create $faildir";
391 392 }
392   - if (-f "$outputdir/.config") {
393   - cp "$outputdir/.config", "$faildir/config" or
  393 + if (-f "$output_config") {
  394 + cp "$output_config", "$faildir/config" or
394 395 die "failed to copy .config";
395 396 }
396 397 if (-f $buildlog) {
... ... @@ -619,7 +620,7 @@
619 620  
620 621 # should we process modules?
621 622 $install_mods = 0;
622   - open(IN, "$outputdir/.config") or dodie("Can't read config file");
  623 + open(IN, "$output_config") or dodie("Can't read config file");
623 624 while (<IN>) {
624 625 if (/CONFIG_MODULES(=y)?/) {
625 626 $install_mods = 1 if (defined($1));
... ... @@ -706,7 +707,7 @@
706 707 unlink $buildlog;
707 708  
708 709 if ($type =~ /^useconfig:(.*)/) {
709   - run_command "cp $1 $outputdir/.config" or
  710 + run_command "cp $1 $output_config" or
710 711 dodie "could not copy $1 to .config";
711 712  
712 713 $type = "oldconfig";
713 714  
714 715  
715 716  
... ... @@ -717,20 +718,20 @@
717 718 $type = "oldnoconfig";
718 719  
719 720 # allow for empty configs
720   - run_command "touch $outputdir/.config";
  721 + run_command "touch $output_config";
721 722  
722   - run_command "mv $outputdir/.config $outputdir/config_temp" or
  723 + run_command "mv $output_config $outputdir/config_temp" or
723 724 dodie "moving .config";
724 725  
725 726 if (!$noclean && !run_command "$make mrproper") {
726 727 dodie "make mrproper";
727 728 }
728 729  
729   - run_command "mv $outputdir/config_temp $outputdir/.config" or
  730 + run_command "mv $outputdir/config_temp $output_config" or
730 731 dodie "moving config_temp";
731 732  
732 733 } elsif (!$noclean) {
733   - unlink "$outputdir/.config";
  734 + unlink "$output_config";
734 735 run_command "$make mrproper" or
735 736 dodie "make mrproper";
736 737 }
... ... @@ -1292,6 +1293,7 @@
1292 1293 $buildlog = "$tmpdir/buildlog-$machine";
1293 1294 $dmesg = "$tmpdir/dmesg-$machine";
1294 1295 $make = "$makecmd O=$outputdir";
  1296 + $output_config = "$outputdir/.config";
1295 1297  
1296 1298 if ($reboot_type eq "grub") {
1297 1299 dodie "GRUB_MENU not defined" if (!defined($grub_menu));