continuous: Fix configuration step for newer kernels
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Apr 2014 12:44:06 +0000 (14:44 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Apr 2014 12:44:06 +0000 (14:44 +0200)
It is not sufficient to always answer no. The "choice" question needs
Enter or a number. We answer with Enter.

continuous/steps/20-config
continuous/steps/my-oldconfig.pl [new file with mode: 0755]

index dfbaad2..a58c94f 100755 (executable)
@@ -62,4 +62,4 @@ conf NETFILTER y
 
 conf PACKET y # ugw mmap
 
-timeout 2m yes n|chronic make oldconfig
+chronic ../my-oldconfig.pl
diff --git a/continuous/steps/my-oldconfig.pl b/continuous/steps/my-oldconfig.pl
new file mode 100755 (executable)
index 0000000..17080b4
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/perl -w
+
+use Expect;
+my $exp = Expect->spawn("make oldconfig")
+    or die "Cannot spawn make oldconfig: $!\n";
+
+my $timeout = 1;
+$exp->expect($timeout,
+            [ '^ *choice\[.*\]: '           => sub { $exp->send("\n");  exp_continue; } ],
+            [ '^([^ ]| *[^>0-9]).*\(NEW\) ' => sub { $exp->send("n\n"); exp_continue; } ],
+            [ "configuration written to .config" ],
+    ) || die "Timeout"