View | Details | Raw Unified | Return to bug 27059
Collapse All | Expand All

(-)a/installer/data/mysql/updatedatabase.pl (-6 / +27 lines)
Lines 23500-23505 sub SetVersion { Link Here
23500
    C4::Context::clear_syspref_cache(); # invalidate cached preferences
23500
    C4::Context::clear_syspref_cache(); # invalidate cached preferences
23501
}
23501
}
23502
23502
23503
my $start_time = time;
23503
sub NewVersion {
23504
sub NewVersion {
23504
    my ( $DBversion, $bug_number, $descriptions ) = @_;
23505
    my ( $DBversion, $bug_number, $descriptions ) = @_;
23505
23506
Lines 23509-23535 sub NewVersion { Link Here
23509
        $descriptions = [ $descriptions ];
23510
        $descriptions = [ $descriptions ];
23510
    }
23511
    }
23511
    my $first = 1;
23512
    my $first = 1;
23512
    my $time = POSIX::strftime("%H:%M:%S",localtime);
23513
    my ( $seconds, $time, $elapsed ) = get_timestrings();
23513
    for my $description ( @$descriptions ) {
23514
    for my $description ( @$descriptions ) {
23514
        if ( @$descriptions > 1 ) {
23515
        if ( @$descriptions > 1 ) {
23515
            if ( $first ) {
23516
            if ( $first ) {
23516
                unless ( $bug_number ) {
23517
                unless ( $bug_number ) {
23517
                    say sprintf "Upgrade to %s done [%s]: %s", $DBversion, $time, $description;
23518
                    say sprintf "Upgrade to %s done [%s %s]: %s", $DBversion, $time, $elapsed, $description;
23518
                } else {
23519
                } else {
23519
                    say sprintf "Upgrade to %s done [%s]: Bug %5s - %s", $DBversion, $time, $bug_number, $description;
23520
                    say sprintf "Upgrade to %s done [%s %s]: Bug %5s - %s", $DBversion, $time, $elapsed, $bug_number, $description;
23520
                }
23521
                }
23521
            } else {
23522
            } else {
23522
                say sprintf "\t\t\t\t\t\t   - %s", $description;
23523
                say sprintf "\t\t\t\t\t\t   - %s", $description;
23523
            }
23524
            }
23524
        } else {
23525
        } else {
23525
            unless ( $bug_number ) {
23526
            unless ( $bug_number ) {
23526
                say sprintf "Upgrade to %s done [%s]: %s", $DBversion, $time, $description;
23527
                say sprintf "Upgrade to %s done [%s %s]: %s", $DBversion, $time, $elapsed, $description;
23527
            } else {
23528
            } else {
23528
                say sprintf "Upgrade to %s done [%s]: Bug %5s - %s", $DBversion, $time, $bug_number, $description;
23529
                say sprintf "Upgrade to %s done [%s %s]: Bug %5s - %s", $DBversion, $time, $elapsed, $bug_number, $description;
23529
            }
23530
            }
23530
        }
23531
        }
23531
        $first = 0;
23532
        $first = 0;
23532
    }
23533
    }
23534
    $start_time = $seconds;
23535
}
23536
23537
sub get_timestrings {
23538
    use integer;
23539
    my $now        = time;
23540
    my $elapsed    = $now - $start_time;
23541
    local $_ = $elapsed;
23542
    my ( $d, $h, $m, $s );
23543
    $s = $_ % 60;
23544
    $_ /= 60;
23545
    $m = $_ % 60;
23546
    $_ /= 60;
23547
    $h = $_ % 24;
23548
    $_ /= 24;
23549
    $d = $_;
23550
23551
    my $now_pretty = POSIX::strftime("%H:%M:%S",localtime($now));
23552
    my $elapsed_pretty = $d ? "($d:$h:$m:$s)" : $h ? "($h:$m:$s)" : $m ? "($m:$s)" : "($s)";
23553
23554
    return ( $now, $now_pretty, $elapsed_pretty);
23533
}
23555
}
23534
23556
23535
=head2 CheckVersion
23557
=head2 CheckVersion
23536
- 

Return to bug 27059