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

(-)a/installer/data/mysql/updatedatabase.pl (-4 / +9 lines)
Lines 50-55 use constant ATOMICUPD_PREF => '_LocalAtomicUpdates'; Link Here
50
my $debug = 0;
50
my $debug = 0;
51
my $aupd = { #hash for atomic updates
51
my $aupd = { #hash for atomic updates
52
    location  => C4::Context->config('intranetdir')."/installer/data/mysql/atomicupdate",
52
    location  => C4::Context->config('intranetdir')."/installer/data/mysql/atomicupdate",
53
    mode      => C4::Context->preference('DevUpdateControl') // 'PROD',
53
    remember  => C4::Context->preference(ATOMICUPD_PREF)//'',
54
    remember  => C4::Context->preference(ATOMICUPD_PREF)//'',
54
    skipfiles => {
55
    skipfiles => {
55
        'Bug-4246-Talking-Tech-itiva-phone-notifications.pl' => 1,
56
        'Bug-4246-Talking-Tech-itiva-phone-notifications.pl' => 1,
Lines 8864-8870 if ( CheckVersion($DBversion) ) { Link Here
8864
# This point marks the end of the approved database revisions.
8865
# This point marks the end of the approved database revisions.
8865
# The following line runs proposed patches found in atomicupdate. On a
8866
# The following line runs proposed patches found in atomicupdate. On a
8866
# production system, it will [should] not find any.
8867
# production system, it will [should] not find any.
8867
RunRemainingAtomicUpdates( $aupd );
8868
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD';
8868
8869
8869
=head1 FUNCTIONS
8870
=head1 FUNCTIONS
8870
8871
Lines 8888-8894 sub RunRemainingAtomicUpdates { Link Here
8888
           print "Skipping $upd as installed official db rev\n";
8889
           print "Skipping $upd as installed official db rev\n";
8889
           next;
8890
           next;
8890
        }
8891
        }
8891
        if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) {
8892
        if( $atomicupd->{mode} ne 'ALWAYS' &&
8893
            $atomicupd->{remember} =~ /(^|;)$upd;/ ) {
8892
        #Skip files that have recently been applied
8894
        #Skip files that have recently been applied
8893
        #Note that an official db rev erases this list
8895
        #Note that an official db rev erases this list
8894
           print "Skipping $upd as recently applied dev update\n";
8896
           print "Skipping $upd as recently applied dev update\n";
Lines 8946-8952 sub ExecDBRev { Link Here
8946
        print "Dev upgrade $file done\n";
8948
        print "Dev upgrade $file done\n";
8947
        _atomic_memory( $atomicupd, $file ) if $rv;
8949
        _atomic_memory( $atomicupd, $file ) if $rv;
8948
    } else {
8950
    } else {
8949
        _atomic_memory( $atomicupd ); #Official db rev clears the atomic pref
8951
        _atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref
8950
        SetVersion($version);
8952
        SetVersion($version);
8951
        print "Upgrade to $version done (Bug $bugno - $descr)\n";
8953
        print "Upgrade to $version done (Bug $bugno - $descr)\n";
8952
    }
8954
    }
Lines 8954-8959 sub ExecDBRev { Link Here
8954
8956
8955
sub _atomic_memory {
8957
sub _atomic_memory {
8956
    my ( $atomicupd, $upd ) = @_;
8958
    my ( $atomicupd, $upd ) = @_;
8959
8960
    return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref
8961
    return if !$upd &&  $atomicupd->{mode} eq 'TRACK'; # no reset
8962
8957
    $atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": '';
8963
    $atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": '';
8958
    C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} );
8964
    C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} );
8959
}
8965
}
8960
- 

Return to bug 13068