Lines 50-61
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->config('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, |
56 |
'oai_sets.sql' => 1, |
57 |
'oai_sets.sql' => 1, |
57 |
}, |
58 |
}, |
58 |
}; |
59 |
}; |
|
|
60 |
# Short explanation of the various dev update control modes: |
61 |
# PROD: Only install official database revisions (default and fallback) |
62 |
# RESET: After an official database rev, reinstall all development updates |
63 |
# ALWAYS: When upgrading, reinstall all development updates |
64 |
# TRACK: Do not reinstall applied development updates |
59 |
|
65 |
|
60 |
my ( |
66 |
my ( |
61 |
$sth, $sti, |
67 |
$sth, $sti, |
Lines 9610-9616
sub RunRemainingAtomicUpdates {
Link Here
|
9610 |
if( exists $atomicupd->{skipfiles}->{$upd} ) { |
9616 |
if( exists $atomicupd->{skipfiles}->{$upd} ) { |
9611 |
next; # Skip official db revision |
9617 |
next; # Skip official db revision |
9612 |
} |
9618 |
} |
9613 |
if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
9619 |
if( $atomicupd->{mode} ne 'ALWAYS' && |
|
|
9620 |
$atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
9614 |
#Skip files that have recently been applied |
9621 |
#Skip files that have recently been applied |
9615 |
#Note that an official db rev erases this list |
9622 |
#Note that an official db rev erases this list |
9616 |
print "Skipping $upd as recently applied dev update\n"; |
9623 |
print "Skipping $upd as recently applied dev update\n"; |
Lines 9668-9674
sub ExecDBRev {
Link Here
|
9668 |
print "Dev upgrade $file done\n"; |
9675 |
print "Dev upgrade $file done\n"; |
9669 |
_atomic_memory( $atomicupd, $file ) if $rv; |
9676 |
_atomic_memory( $atomicupd, $file ) if $rv; |
9670 |
} else { |
9677 |
} else { |
9671 |
_atomic_memory( $atomicupd ); #Official db rev clears the atomic pref |
9678 |
_atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref |
9672 |
SetVersion($version); |
9679 |
SetVersion($version); |
9673 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
9680 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
9674 |
} |
9681 |
} |
Lines 9676-9681
sub ExecDBRev {
Link Here
|
9676 |
|
9683 |
|
9677 |
sub _atomic_memory { |
9684 |
sub _atomic_memory { |
9678 |
my ( $atomicupd, $upd ) = @_; |
9685 |
my ( $atomicupd, $upd ) = @_; |
|
|
9686 |
|
9687 |
return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref |
9688 |
return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset |
9689 |
|
9679 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
9690 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
9680 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
9691 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
9681 |
} |
9692 |
} |
Lines 9789-9793
sub CheckVersion {
Link Here
|
9789 |
} |
9800 |
} |
9790 |
} |
9801 |
} |
9791 |
|
9802 |
|
9792 |
RunRemainingAtomicUpdates( $aupd ); |
9803 |
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; |
9793 |
exit; |
9804 |
exit; |
9794 |
- |
|
|