Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 40 additions and 0 deletions.
  1. +38 −0 Configure.pl
  2. +2 −0 lib/Parrot/Configure/Utils.pm
View
38 Configure.pl
@@ -23,6 +23,44 @@
$| = 1; # $OUTPUT_AUTOFLUSH = 1;
+sub tee {
+ # Try forking.
+ my $pid = open(STDOUT, "|-");
+ die "cannot fork: $!" unless defined $pid;
+
+ if ($pid) {
+ # Parent redirects stderr to stdout and returns.
+ open(STDERR, ">&STDOUT");
+ }
+ else {
+ # Child opens the log file and then exits when the parent does.
+ die "cannot open config.log for writing: $!" unless open(my $handle, ">", "config.log");
+
+ select($handle);
+ $| = 1;
+
+ while(sysread(*STDIN, $_, 2048) > 0) {
+ # Log prompt responses to file as well.
+ if(/^<promptanswer (.*)>\n(.*)$/) {
+ print "$1\n";
+
+ # If we slurped some extra data, print that normally.
+ if($2) {
+ print $2;
+ print STDOUT $2;
+ }
+
+ next;
+ }
+
+ print $_;
+ print STDOUT $_;
+ }
+ exit;
+ }
+}
+tee();
+
# Install Option text was taken from:
#
# autoconf (GNU Autoconf) 2.59
View
2 lib/Parrot/Configure/Utils.pm
@@ -161,6 +161,8 @@ sub prompt {
$value = $input;
}
+ print("<promptanswer $input>\n");
+
return integrate( $value, $input );
}

No commit comments for this range

Something went wrong with that request. Please try again.