Following some remark from matthieu, since we now can distinguish
clean builds from unclean builds, we can reset the pos marker in such
a case.

Of course, since this happens at the end of a task, this only changes
the display *after* the first step, but this is what matters, really,
since we don't really care about the % display for quick building ports.


(and of course, we lose all benefits if it breaks and we restart again
without cleaning anything, but we're one step away from a demogorgon at
this point)

Thoroughly untested, waiting for my bulk to finish.

Index: Clock.pm
===================================================================
RCS file: /cvs/ports/infrastructure/lib/DPB/Clock.pm,v
retrieving revision 1.20
diff -u -p -r1.20 Clock.pm
--- Clock.pm    6 Jun 2023 08:09:13 -0000       1.20
+++ Clock.pm    7 Jul 2023 08:50:36 -0000
@@ -166,6 +166,11 @@ sub reset_offset($self)
        }
 }
 
+sub set_offset($self, $pos)
+{
+       $self->{offset} = $pos;
+}
+
 sub stopped_clock($self, $gap, $)
 {
        $self->{time} += $gap if defined $self->{time};
Index: Job/Port.pm
===================================================================
RCS file: /cvs/ports/infrastructure/lib/DPB/Job/Port.pm,v
retrieving revision 1.212
diff -u -p -r1.212 Port.pm
--- Job/Port.pm 21 Jun 2023 08:56:17 -0000      1.212
+++ Job/Port.pm 7 Jul 2023 08:50:36 -0000
@@ -62,6 +62,10 @@ sub finalize($self, $core)
                                last if !defined $l;
                                if ($l =~ m/^\=\=\=\>\s+Building from scratch/) 
{
                                        $job->{fromscratch} = $i;
+                                       if (defined $job->{watched}) {
+                                               $job->{watched}->set_offset(
+                                                   $job->{pos});
+                                       }
                                        last;
                                }
                        }

Reply via email to