9 mkdir -p version-charset-test
10 cd version-charset-test
25 #git commit --allow-empty -m 'Test object'
26 #head=`git rev-parse HEAD`
39 my @freecpus = qw('"$cpus"');
41 print STDERR "check using cpus @freecpus\n";
44 my ($pid, $cpu, $oldbatch) = @{ shift @tasks };
45 waitpid $pid, 0 == $pid or die $!;
46 die "$oldbatch $?" if $?;
47 unlink "b$oldbatch" or die "$oldbatch $!";
48 # print STDERR "check completed $oldbatch [$pid] #$cpu\n";
52 sub complete_batch () {
55 close $file or die $!;
57 # print STDERR "check closing $batch ($count)\n";
59 await_task unless @freecpus;
61 my $cpu = shift @freecpus;
63 my $pid = fork // die $!;
68 open STDIN, "<", "b$batch" or die $batch;
69 chdir "c$cpu" or die "$cpu $!";
70 exec qw(eatmydata git update-ref --stdin);
73 # print STDERR "check spawned $batch ($count) [$pid] #$cpu\n";
74 push @tasks, [ $pid, $cpu, $batch ];
82 #print STDERR ">$_<\n";
83 $file ||= new IO::File "b$batch", ">" or die $!;
85 print $file "delete refs/tags/$_\n" or die $!;
86 $count++ < 1000 or complete_batch;
88 #print STDERR "FOO\n";
89 STDIN->error and die $!;
91 await_task while @tasks;
92 print STDERR "check exiting (total=$total)\n";