+# Not as sophisticated as the guestfish progress bar, because
+# I intend to use an external library for this at some point (XXX).
+sub progress_callback
+{
+ my $proc_nr = shift;
+ my $serial = shift;
+ my $position = shift;
+ my $total = shift;
+
+ my $ratio = $position / $total;
+ if ($ratio < 0) { $ratio = 0 }
+ elsif ($ratio > 1) { $ratio = 1 }
+
+ my $dots = int ($ratio * 76);
+
+ print "[", "#"x$dots, "-"x(76-$dots), "]\r";
+ print "\n" if $ratio == 1;
+}
+