13 generate-recent.pl [OPTIONS]
21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
29 Parameter to pass to 'makeperl.pl'. Defaults to 1 which is usually
30 what we want. But in rare situations, when for example TEST produces a
31 fail but harness produces a pass, this comes in handy.
33 Update 2017-12-11 akoenig: I do not understand what I wanted to say
36 =item B<--keepfilesonerror!>
38 Do not do any cleanup on error, just bail out with an error.
44 Runs makeperl.pl in a loop. Stops when no patches have arrived.
46 The loop is to run installed-perls-overview and inspect the list from
47 top to bottom. It is expected that the list is based on I<git
48 describe> and sorted like the trunk. And when the current 'git
49 describe' matches the first line, then we have nothing to do.
51 We set --jobs to 1 because at the moment we are much faster (>100
52 times) than the smoker and sleep long times between invocations. If we
53 were yet faster we would only waste both disk and CPU.
59 use lib
"$FindBin::Bin/../lib";
65 use File
::Basename
qw(dirname);
66 use File
::Path
qw(mkpath);
70 use Hash
::Util
qw(lock_keys);
74 lock_keys
%Opt, map { /([^=!\|]+)/ } @opt;
88 my @valid_debuggingoptions = (("EBUGGING=both")x1
, ("EBUGGING=-g")x5
, ("EBUGGING=none")x7
);
92 if ( $waitabit > time ) {
93 my $sleep = $waitabit - time;
94 $sleep = 1 if $sleep < 1;
97 $waitabit = time +120; # arbitrary
99 open my $fh, "-|", $^X
, "$FindBin::Bin/installed-perls-overview.pl", "--max=100", "--minperl=v5.15.7";
100 my(@perls,%perls_seen);
101 OVLINE
: while (<$fh>) {
102 my($perl) = split " ", $_, 2;
103 my $hostname = Sys
::Hostname
::hostname
;
104 $hostname =~ s/\..*//;
106 if ($hostname eq "k83") {
107 $perl_or_host = "perl";
109 $perl_or_host = "host/$hostname";
111 # Can't exec "/home/sand/src/perl/repoperls/installed-perls/perl/v5.23.7-35-g6002757/3bd2/bin/perl": No such...
112 my $absperl = sprintf "/home/sand/src/perl/repoperls/installed-perls/%s/%s/bin/perl", $perl_or_host, $perl;
113 open my $fh2, "-|", $absperl, "-V:useithreads|uselongdouble";
114 my @stat = stat $absperl;
115 my $mtime = POSIX
::strftime
"%FT%TZ", gmtime $stat[9];
118 my($k,$v) = /(\w+)='(\w*)';/;
119 $conf{$k} = $v || 'undef';
121 next OVLINE
if $perls_seen{join ",", @conf{qw(useithreads uselongdouble)}}++;
122 push @perls, +{ perl
=> $perl, mtime
=> $mtime, %conf };
123 last OVLINE
if @perls >= 4;
125 warn YAML
::Syck
::Dump \
@perls;
126 my @system_git = (git
=> "pull");
128 last if 0 == system @system_git;
129 warn sprintf "%s UTC: git poll has failed, sleeping 900 for the next retry\n", scalar gmtime;
130 sleep 900; # arbitrary
132 my $describe = `git describe`;
136 substr($perls[0]{perl
},0,index($perls[0]{perl
},"/"))) {
137 my $sleep = 2700; # arbitrary
138 my $eta = time+$sleep;
141 my $left = $eta - time;
143 printf "\r%d ", $left;
151 $ud = sprintf "%s%s",
152 uc(substr($perls[3]{useithreads
}||qw(D U)[int rand 2], 0, 1)),
153 uc(substr($perls[3]{uselongdouble
}||qw(D U)[int rand 2], 0, 1));
155 my %pickud = map { $_ => 1 } qw(UU UD DU DD);
157 my $thisud = sprintf "%s%s",
158 uc(substr($p->{useithreads
}, 0, 1)),
159 uc(substr($p->{uselongdouble
}, 0, 1));
160 delete $pickud{$thisud};
162 $ud = (keys %pickud)[int rand scalar keys %pickud];
164 my $debuggingoption = $valid_debuggingoptions[int rand scalar @valid_debuggingoptions];
167 $DB::VERSION ?
("-d") : (),
168 "$FindBin::Bin/makeperl.pl",
172 "--debuggingoption=$debuggingoption",
173 $Opt{keepfilesonerror
} ?
"--keepfilesonerror" : (),
175 warn YAML
::Syck
::Dump \
@system_mp;
176 sleep 3; # just so that the message can be seen
177 0 == system @system_mp or die "Alert: problem running system[@system_mp]";
182 # cperl-indent-level: 4