tools/testing/ktest/config-bisect.pl

Source file repositories/reference/linux-study-clean/tools/testing/ktest/config-bisect.pl

File Facts

System
Linux kernel
Corpus path
tools/testing/ktest/config-bisect.pl
Extension
.pl
Size
18118 bytes
Lines
770
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if ($file =~ m,^/,) {
	return $file;
    }
    return "$pwd/$file";
}

sub read_prompt {
    my ($cancel, $prompt) = @_;

    my $ans;

    for (;;) {
	if ($cancel) {
	    print "$prompt [y/n/C] ";
	} else {
	    print "$prompt [y/N] ";
	}
	$ans = <STDIN>;
	chomp $ans;
	if ($ans =~ /^\s*$/) {
	    if ($cancel) {
		$ans = "c";
	    } else {
		$ans = "n";
	    }
	}
	last if ($ans =~ /^y$/i || $ans =~ /^n$/i);
	if ($cancel) {
	    last if ($ans =~ /^c$/i);
	    print "Please answer either 'y', 'n' or 'c'.\n";
	} else {
	    print "Please answer either 'y' or 'n'.\n";
	}
    }
    if ($ans =~ /^c/i) {
	exit;
    }
    if ($ans !~ /^y$/i) {
	return 0;
    }
    return 1;
}

sub read_yn {
    my ($prompt) = @_;

    return read_prompt 0, $prompt;
}

sub read_ync {
    my ($prompt) = @_;

    return read_prompt 1, $prompt;
}

sub run_command {
    my ($command, $redirect) = @_;
    my $start_time;
    my $end_time;
    my $dord = 0;
    my $pid;

    $start_time = time;

    doprint("$command ... ");

    $pid = open(CMD, "$command 2>&1 |") or
	dodie "unable to exec $command";

    if (defined($redirect)) {

Annotation

Implementation Notes